diff --git a/src/Storage/Storage.Management/help/Add-AzRmStorageContainerLegalHold.md b/src/Storage/Storage.Management/help/Add-AzRmStorageContainerLegalHold.md index 835d30d33b4c..e0196a6db24c 100644 --- a/src/Storage/Storage.Management/help/Add-AzRmStorageContainerLegalHold.md +++ b/src/Storage/Storage.Management/help/Add-AzRmStorageContainerLegalHold.md @@ -39,23 +39,23 @@ The **Add-AzRmStorageContainerLegalHold** cmdlet adds legal hold tags to a Stora ## EXAMPLES ### Example 1: Add legal hold tags to a Storage blob container with Storage account name and container name -``` -PS C:\>Add-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag tag1,tag2 -AllowProtectedAppendWriteAll $true +```powershell +Add-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag tag1,tag2 -AllowProtectedAppendWriteAll $true ``` This command adds legal hold tags to a Storage blob container with Storage account name and container name, and set AllowProtectedAppendWriteAll as true to allow append new blocks to append or block blob. ### Example 2: Add legal hold tags to a Storage blob container with Storage account object and container name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Add-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer" -Tag tag1 +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Add-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer" -Tag tag1 ``` This command adds legal hold tags to a Storage blob container with Storage account object and container name. ### Example 3: Add legal hold tags to all Storage blob containers in a Storage account with pipeline -``` -PS C:\>Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Add-AzRmStorageContainerLegalHold -Tag tag1,tag2,tag3 +```powershell +Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Add-AzRmStorageContainerLegalHold -Tag tag1,tag2,tag3 ``` This command adds legal hold tags to all Storage blob containers in a Storage account with pipeline. diff --git a/src/Storage/Storage.Management/help/Add-AzStorageAccountNetworkRule.md b/src/Storage/Storage.Management/help/Add-AzStorageAccountNetworkRule.md index cea4a10c2128..0c52d6689cfa 100644 --- a/src/Storage/Storage.Management/help/Add-AzStorageAccountNetworkRule.md +++ b/src/Storage/Storage.Management/help/Add-AzStorageAccountNetworkRule.md @@ -58,45 +58,45 @@ The **Add-AzStorageAccountNetworkRule** cmdlet adds IpRules or VirtualNetworkRul ## EXAMPLES ### Example 1: Add several IpRules with IPAddressOrRange -``` -PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPAddressOrRange "10.0.0.0/7","28.2.0.0/16" +```powershell +Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPAddressOrRange "10.0.0.0/7","28.2.0.0/16" ``` This command add several IpRules with IPAddressOrRange. ### Example 2: Add a VirtualNetworkRule with VirtualNetworkResourceID -``` -PS C:\>$subnet = Get-AzVirtualNetwork -ResourceGroupName "myResourceGroup" -Name "myvirtualnetwork" | Get-AzVirtualNetworkSubnetConfig -PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkResourceId $subnet[0].Id +```powershell +$subnet = Get-AzVirtualNetwork -ResourceGroupName "myResourceGroup" -Name "myvirtualnetwork" | Get-AzVirtualNetworkSubnetConfig +Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkResourceId $subnet[0].Id ``` This command add a VirtualNetworkRule with VirtualNetworkResourceID. ### Example 3: Add VirtualNetworkRules with VirtualNetworkRule Objects from another account -``` -PS C:\> $networkrule = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1" -PS C:\> Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2" -VirtualNetworkRule $networkrule.VirtualNetworkRules +```powershell +$networkrule = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1" +Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2" -VirtualNetworkRule $networkrule.VirtualNetworkRules ``` This command add VirtualNetworkRules with VirtualNetworkRule Objects from another account. ### Example 4: Add several IpRule with IpRule objects, input with JSON -``` -PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPRule (@{IPAddressOrRange="10.0.0.0/7";Action="allow"},@{IPAddressOrRange="28.2.0.0/16";Action="allow"}) +```powershell +Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPRule (@{IPAddressOrRange="10.0.0.0/7";Action="allow"},@{IPAddressOrRange="28.2.0.0/16";Action="allow"}) ``` This command add several IpRule with IpRule objects, input with JSON. ### Example 5: Add a resource access rule -``` -PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -TenantId $tenantId -ResourceId $ResourceId +```powershell +Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -TenantId $tenantId -ResourceId $ResourceId ``` This command adds a resource access rule with TenantId and ResourceId. ### Example 6: Add all resource access rules of one storage account to another storage account -``` -PS C:\> (Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1").ResourceAccessRules | Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2" +```powershell +(Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1").ResourceAccessRules | Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2" ``` This command gets all resource access rules from one storage account, and adds them to another storage account. diff --git a/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md b/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md index 02ebc701dc0f..f1f4ffd36f96 100644 --- a/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md +++ b/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md @@ -66,31 +66,32 @@ The **Close-AzStorageFileHandle** cmdlet closes file handles of a file share, o ## EXAMPLES ### Example 1: Close all file handles on a file -``` -PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -CloseAll +```powershell +Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -CloseAll ``` This command closes all file handles on a file. ### Example 2: Close all file handles which is opened 1 day ago on a file directory -``` -PS C:\> Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive | Where-Object {$_.OpenTime.DateTime.AddDays(1) -lt (Get-Date)} | Close-AzStorageFileHandle -ShareName "mysharename" +```powershell +Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive | Where-Object {$_.OpenTime.DateTime.AddDays(1) -lt (Get-Date)} | Close-AzStorageFileHandle -ShareName "mysharename" ``` This command lists all file handles on a file directory recursively, filters out the handles which are opened 1 day ago, and then closes them. ### Example 3: Close all file handles on a file directory recursively and show the closed file handle count - +```powershell +Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -CloseAll -PassThru ``` -PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -CloseAll -PassThru +```output 10 ``` This command closes all file handles on a file directory and shows the closed file handle count. ### Example 4: Close all file handles on a file share -``` -PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -CloseAll -Recursive +```powershell +Close-AzStorageFileHandle -ShareName "mysharename" -CloseAll -Recursive ``` This command closes all file handles on a specific file share recursively. diff --git a/src/Storage/Storage.Management/help/Copy-AzStorageBlob.md b/src/Storage/Storage.Management/help/Copy-AzStorageBlob.md index f5d7d688a07d..21b067017803 100644 --- a/src/Storage/Storage.Management/help/Copy-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Copy-AzStorageBlob.md @@ -42,14 +42,14 @@ The **Copy-AzStorageBlob** cmdlet copies a blob synchronously, currently only su ## EXAMPLES ### Example 1: Copy a named blob to another -``` +```powershell $destBlob = Copy-AzStorageBlob -SrcContainer "sourcecontainername" -SrcBlob "srcblobname" -DestContainer "destcontainername" -DestBlob "destblobname" ``` This command copies a blob from source container to the destination container with a new blob name. ### Example 2: Copy blob from a blob object -``` +```powershell $srcBlob = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $ctx $destBlob = $srcBlob | Copy-AzStorageBlob -DestContainer "destcontainername" -DestBlob "destblobname" ``` @@ -57,7 +57,7 @@ $destBlob = $srcBlob | Copy-AzStorageBlob -DestContainer "destcontainername" - This command copies a blob from source blob object to the destination container with a new blob name. ### Example 3: Copy blob from a blob Uri -``` +```powershell $srcBlobUri = New-AzStorageBlobSASToken -Container $srcContainerName -Blob $srcBlobName -Permission rt -ExpiryTime (Get-Date).AddDays(7) -FullUri $destBlob = Copy-AzStorageBlob -AbsoluteUri $srcBlobUri -DestContainer "destcontainername" -DestBlob "destblobname" ``` @@ -65,14 +65,14 @@ $destBlob = Copy-AzStorageBlob -AbsoluteUri $srcBlobUri -DestContainer "destcont The first command creates a blob Uri of the source blob, with sas token of permission "rt". The second command copies from source blob Uri to the destination blob. ### Example 4: Update a block blob encryption scope -``` +```powershell $blob = Copy-AzStorageBlob -SrcContainer $containerName -SrcBlob $blobname -DestContainer $containername -EncryptionScope $newScopeName -Force ``` This command update a block blob encryption scope by copy it to itself with a new encryption scope. ### Example 5: Copy a blob to a new append blob -``` +```powershell $srcBlob = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $ctx $destBlob = Copy-AzStorageBlob -SrcContainer "sourcecontainername" -SrcBlob "srcblobname" -DestContainer "destcontainername" -DestBlob "destblobname" -DestBlobType "Append" -DestContext $destCtx ``` diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md index b37f2986e9e1..9068555d31b0 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md @@ -35,11 +35,11 @@ The **Disable-AzStorageBlobDeleteRetentionPolicy** cmdlet disables delete retent ## EXAMPLES -### Example 1: Disable delete retention policy for the Blob service - +### Example 1: Disable delete retention policy for the Blob services +```powershell +Disable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru ``` -C:\PS>Disable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru - +```output Enabled Days ------- ---- False diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageBlobLastAccessTimeTracking.md b/src/Storage/Storage.Management/help/Disable-AzStorageBlobLastAccessTimeTracking.md index 88997d3d9696..4e5efa99557d 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageBlobLastAccessTimeTracking.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageBlobLastAccessTimeTracking.md @@ -30,8 +30,8 @@ The **Disable-AzStorageBlobDeleteRetentionPolicy** cmdlet disables delete retent ## EXAMPLES ### Example 1: Disable last access time tracking for the Blob service -``` -C:\PS>Disable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" +```powershell +Disable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ``` This command disables last access time tracking for the Blob service. diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageBlobRestorePolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageBlobRestorePolicy.md index cb62fb359b3c..c9f8c2df9742 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageBlobRestorePolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageBlobRestorePolicy.md @@ -37,7 +37,7 @@ The **Disable-AzStorageBlobRestorePolicy** cmdlet disables Blob Restore Policy f ### Example 1: Disables Blob Restore Policy for the Azure Storage Blob service on a Storage account ```powershell -PS C:\> Disable-AzStorageBlobRestorePolicy -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" +Disable-AzStorageBlobRestorePolicy -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" ``` This command Disables Blob Restore Policy for the Azure Storage Blob service on a Storage account. diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md index 0cc650ea8e99..ad926040ed55 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md @@ -36,10 +36,11 @@ The **Disable-AzStorageContainerDeleteRetentionPolicy** cmdlet disables delete r ## EXAMPLES ### Example 1: Disable delete retention policy for blob containers - +```powershell +Disable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru ``` -C:\PS>Disable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru +```output Enabled Days ------- ---- False diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageDeleteRetentionPolicy.md index 755e0db67e02..7054b4458e76 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageDeleteRetentionPolicy.md @@ -23,8 +23,8 @@ The **Disable-AzStorageDeleteRetentionPolicy** cmdlet disables delete retention ## EXAMPLES ### Example 1: Disable delete retention policy for the Blob service -``` -C:\PS>Disable-AzStorageDeleteRetentionPolicy +```powershell +Disable-AzStorageDeleteRetentionPolicy ``` This command disables delete retention policy for the Blob service. diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageStaticWebsite.md b/src/Storage/Storage.Management/help/Disable-AzStorageStaticWebsite.md index d3de72acd699..8f9d8e2df86d 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageStaticWebsite.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageStaticWebsite.md @@ -23,8 +23,8 @@ The **Disable-AzStorageStaticWebsite** cmdlet disables static website for the Az ## EXAMPLES ### Example 1: Disable static website for a Azure Storage account -``` -C:\PS>Disable-AzStorageStaticWebsite +```powershell +Disable-AzStorageStaticWebsite ``` This command disables static website for a Azure Storage account. diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md index a5340f4638ee..b09056fd5085 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md @@ -37,10 +37,11 @@ The **Enable-AzStorageBlobDeleteRetentionPolicy** cmdlet enables delete retentio ## EXAMPLES ### Example 1: Enable delete retention policy for the Blob service - +```powershell +Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -AllowPermanentDelete -PassThru -RetentionDays 4 ``` -C:\PS>Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -AllowPermanentDelete -PassThru -RetentionDays 4 +```output Enabled Days AllowPermanentDelete ------- ---- -------------------- True 4 True diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md b/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md index 1c160622db4e..e84a11dfa0be 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md @@ -30,10 +30,10 @@ The **Enable-AzStorageBlobLastAccessTimeTracking** cmdlet enables last access ti ## EXAMPLES ### Example 1: Enable last access time tracking for the Blob service - +```powershell +Enable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru ``` -C:\PS>Enable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru - +```output Enable Name TrackingGranularityInDays BlobType ------ ---- ------------------------- -------- True AccessTimeTracking 1 {blockBlob} diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md index d04524f3ed70..d67426b6bf60 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md @@ -37,10 +37,10 @@ The **Enable-AzStorageContainerDeleteRetentionPolicy** cmdlet enables delete ret ## EXAMPLES ### Example 1: Enable delete retention policy for Blob containers - +```powershell +Enable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru -RetentionDays 3 ``` -C:\PS>Enable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru -RetentionDays 3 - +```output Enabled Days ------- ---- True 3 diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageDeleteRetentionPolicy.md index f5fa3beeef90..1036b1c34c04 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageDeleteRetentionPolicy.md @@ -23,8 +23,8 @@ The **Enable-AzStorageDeleteRetentionPolicy** cmdlet enables delete retention po ## EXAMPLES ### Example 1: Enable delete retention policy for the Blob service -``` -C:\PS>Enable-AzStorageDeleteRetentionPolicy -RetentionDays 3 +```powershell +Enable-AzStorageDeleteRetentionPolicy -RetentionDays 3 ``` This command enables delete retention policy for the Blob service, and set deleted blob retention days to 3. diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageStaticWebsite.md b/src/Storage/Storage.Management/help/Enable-AzStorageStaticWebsite.md index e02dc2268ac6..e3bfb7455391 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageStaticWebsite.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageStaticWebsite.md @@ -24,8 +24,8 @@ The **Enable-AzStorageStaticWebsite** cmdlet enables static website for the Azur ## EXAMPLES ### Example 1: Enable static website for the Azure Storage account -``` -C:\PS>Enable-AzStorageStaticWebsite -IndexDocument $indexdoc -ErrorDocument404Path $errordoc +```powershell +Enable-AzStorageStaticWebsite -IndexDocument $indexdoc -ErrorDocument404Path $errordoc ``` This command enables static website for the Azure Storage account. diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md index bc95f1331b2a..ea0df68d2826 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md @@ -25,10 +25,11 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: List the direct sub items from a Filesystem - +```powershell +Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" ``` -PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -40,10 +41,11 @@ dir2 True 2020-03-23 09:28:36Z rwxr-x--- This command lists the direct sub items from a Filesystem ### Example 2: List recursively from a directory, and fetch Properties/ACL - +```powershell +Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" -Path "dir1/" -Recurse -FetchProperty ``` -PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" -Path "dir1/" -Recurse -FetchProperty +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -56,12 +58,12 @@ dir1/testfile_1K_0 False 1024 2020-03-23 09:29:21Z rw-r----- This command lists the direct sub items from a Filesystem ### Example 3: List items recursively from a Filesystem in multiple batches -``` -PS C:\> $MaxReturn = 1000 -PS C:\> $FileSystemName = "filesystem1" -PS C:\> $Total = 0 -PS C:\> $Token = $Null -PS C:\> do +```powershell +$MaxReturn = 1000 +$FileSystemName = "filesystem1" +$Total = 0 +$Token = $Null +do { $items = Get-AzDataLakeGen2ChildItem -FileSystem $FileSystemName -Recurse -MaxCount $MaxReturn -ContinuationToken $Token $Total += $items.Count @@ -69,7 +71,7 @@ PS C:\> do $Token = $items[$items.Count -1].ContinuationToken; } While ($null -ne $Token) -PS C:\> Echo "Total $Total items in Filesystem $FileSystemName" +Echo "Total $Total items in Filesystem $FileSystemName" ``` This example uses the *MaxCount* and *ContinuationToken* parameters to list items recursively from a Filesystem in multiple batches. diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md index 57b28d12b384..64bfb7a3e85c 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md @@ -93,10 +93,10 @@ AccessTierChangedOn : 1/1/0001 12:00:00 AM +00:00 This command gets a directory from a Filesystem, and show the details. ### Example 2: Get a file from a Filesystem - +```powershell +Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" ``` -PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" - +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md index 0d94d6a9407a..4aa3d8c2917f 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md @@ -33,10 +33,10 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Download a file without prompt - +```powershell +Get-AzDataLakeGen2ItemContent -FileSystem "filesystem1" -Path "dir1/file1" -Destination $localDestFile -Force ``` -PS C:\> Get-AzDataLakeGen2ItemContent -FileSystem "filesystem1" -Path "dir1/file1" -Destination $localDestFile -Force - +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -47,10 +47,10 @@ dir1/file1 False 1024 2020-03-23 09:29:18Z rwx---rwx This command downloads a file to a local file without prompt. ### Example 2: Get a file, then pipeline to download the file to a local file - +```powershell +Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Get-AzDataLakeGen2ItemContent -Destination $localDestFile ``` -PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Get-AzDataLakeGen2ItemContent -Destination $localDestFile - +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md index c26cf91c8e18..bb65f26493da 100644 --- a/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md @@ -30,32 +30,32 @@ The **Get-AzRmStorageContainer** cmdlet gets or lists Storage blob containers ## EXAMPLES ### Example 1: Get a Storage blob container with Storage account name and container name -``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" ``` This command gets a Storage blob container with Storage account name and container name. ### Example 2: List all Storage blob containers of a Storage account -``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" ``` This command lists all Storage blob containers of a Storage account with Storage account name. ### Example 3: Get a Storage blob container with Storage account object and container name. -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Get-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Get-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" ``` This command gets a Storage blob container with Storage account object and container name. ### Example 4: List Storage blob container of a Storage account, include deleted containers. - +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -IncludeDeleted ``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -IncludeDeleted - +```output ResourceGroupName: myResourceGroup, StorageAccountName: myStorageAccount Name PublicAccess LastModified HasLegalHold HasImmutabilityPolicy Deleted VersionId diff --git a/src/Storage/Storage.Management/help/Get-AzRmStorageContainerImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Get-AzRmStorageContainerImmutabilityPolicy.md index 4bd90348d1bb..7c8ed281c677 100644 --- a/src/Storage/Storage.Management/help/Get-AzRmStorageContainerImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzRmStorageContainerImmutabilityPolicy.md @@ -36,24 +36,24 @@ The **Get-AzRmStorageContainerImmutabilityPolicy** cmdlet gets ImmutabilityPolic ## EXAMPLES ### Example 1: Get ImmutabilityPolicy of a Storage blob container with Storage account name and container name -``` -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" +```powershell +Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" ``` This command gets ImmutabilityPolicy of a Storage blob container with Storage account name and container name. ### Example 2: Get ImmutabilityPolicy of a Storage blob container with Storage account object and container name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" ``` This command gets ImmutabilityPolicy of a Storage blob containers with Storage account object and container name. ### Example 3: Get ImmutabilityPolicy of a Storage blob container with Storage container object -``` -PS C:\>$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject +```powershell +$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" +Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject ``` This command gets ImmutabilityPolicy of a Storage blob container with Storage container object. diff --git a/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md index 88d589d1f278..0664414bb3f2 100644 --- a/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md @@ -48,10 +48,10 @@ The **Get-AzRmStorageShare** cmdlet gets or lists Storage file shares. ## EXAMPLES ### Example 1: Get a Storage file share with Storage account name and share name - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" ``` -PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" - +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes @@ -62,10 +62,10 @@ myshare 5120 This command gets a Storage file share with Storage account name and share name. ### Example 2: List all Storage file shares of a Storage account - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" ``` -PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" - +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes @@ -77,10 +77,11 @@ share2 5120 TransactionOptimized This command lists all Storage file shares of a Storage account with Storage account name. ### Example 3: Get a Storage blob container with Storage account object and container name. - -``` +```powershell Get-AzStorageAccount -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Get-AzRmStorageShare -Name "myshare" +``` +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes @@ -91,10 +92,11 @@ myshare 5120 This command gets a Storage blob container with Storage account object and container name. ### Example 4: Get a Storage file share with the share usage in bytes - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -GetShareUsage ``` -PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -GetShareUsage +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes @@ -105,10 +107,11 @@ myshare 5120 2097152 This command gets a Storage file share with Storage account name and share name, and include the share usage in bytes. ### Example 5: List all Storage file shares of a Storage account, include the deleted shares, include the share snapshots - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -IncludeDeleted -IncludeSnapshot ``` -PS C:\> Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -IncludeDeleted -IncludeSnapshot +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes snapshotTime @@ -121,10 +124,11 @@ share1 100 TransactionOptimized True 01D61FD1FC5498B This command lists all Storage file shares include the deleted shares and share snapshots. ### Example 6: Get a single share snapshot - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "testshare1" -SnapshotTime "2021-05-10T08:04:08Z" ``` -PS C:\> Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "testshare1" -SnapshotTime "2021-05-10T08:04:08Z" +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes snapshotTime diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccount.md b/src/Storage/Storage.Management/help/Get-AzStorageAccount.md index 396289294a63..ac2fc9fd20ac 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccount.md @@ -37,33 +37,33 @@ The **Get-AzStorageAccount** cmdlet gets a specified Storage account or all of t ## EXAMPLES ### Example 1: Get a specified Storage account -``` -PS C:\>Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +```powershell +Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" ``` This command gets the specified Storage account. ### Example 2: Get all Storage accounts in a resource group -``` -PS C:\>Get-AzStorageAccount -ResourceGroupName "RG01" +```powershell +Get-AzStorageAccount -ResourceGroupName "RG01" ``` This command gets all of the Storage accounts in a resource group. ### Example 3: Get all Storage accounts in the subscription -``` -PS C:\>Get-AzStorageAccount +```powershell +Get-AzStorageAccount ``` This command gets all of the Storage accounts in the subscription. ### Example 4: Get a Storage accounts with its blob restore status - -``` -PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "myresourcegoup" -Name "mystorageaccount" -IncludeBlobRestoreStatus - -PS C:\> $account.BlobRestoreStatus +```powershell +$account = Get-AzStorageAccount -ResourceGroupName "myresourcegoup" -Name "mystorageaccount" -IncludeBlobRestoreStatus +$account.BlobRestoreStatus +``` +```output Status RestoreId FailureReason Parameters.TimeToRestore Parameters.BlobRanges ------ --------- ------------- ------------------------ --------------------- InProgress a70cd4a1-f223-4c86-959f-cc13eb4795a8 2020-02-10T13:45:04.7155962Z [container1/blob1 -> container2/blob2] diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md index 85b1b813685d..90567d4d82a4 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md @@ -24,8 +24,8 @@ The **Get-AzStorageAccountKey** cmdlet gets the access keys for an Azure Storage ## EXAMPLES ### Example 1: Get the access keys for a Storage account -``` -PS C:\>Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" +```powershell +Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" ``` This command gets the keys for the specified Azure Storage account. @@ -47,8 +47,8 @@ PS C:\>(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccoun ``` ### Example 3: Lists the access keys for a Storage account, include the Kerberos keys (if active directory enabled) -``` -PS C:\>Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" -ListKerbKey +```powershell +Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" -ListKerbKey ``` This command gets the keys for the specified Azure Storage account. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md index dbf33209aa30..1794c005e5e7 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md @@ -36,10 +36,10 @@ The **Get-AzStorageAccountManagementPolicy** cmdlet gets the management policy o ## EXAMPLES ### Example 1: Get the management policy of a Storage account. - +```powershell +Get-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ``` -PS C:\>Get-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" - +```output ResourceGroupName : myresourcegroup StorageAccountName : mystorageaccount Id : /subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/managementPolicies/default diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountNameAvailability.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountNameAvailability.md index 6d3cccca5865..9eec78b084ac 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountNameAvailability.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountNameAvailability.md @@ -24,8 +24,8 @@ The **Get-AzStorageAccountNameAvailability** cmdlet checks whether the name of a ## EXAMPLES ### Example 1: Check availability of a Storage account name -``` -PS C:\>Get-AzStorageAccountNameAvailability -Name 'contosostorage03' +```powershell +Get-AzStorageAccountNameAvailability -Name 'contosostorage03' ``` This command checks the availability of the name ContosoStorage03. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountNetworkRuleSet.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountNetworkRuleSet.md index f21da8723df2..1cba58b76996 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountNetworkRuleSet.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountNetworkRuleSet.md @@ -23,8 +23,8 @@ The **Get-AzStorageAccountNetworkRuleSet** cmdlet gets the NetworkRule property ## EXAMPLES ### Example 1: Get NetworkRule property of a specified Storage account -``` -PS C:\> Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "rg1" -Name "mystorageaccount" +```powershell +Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "rg1" -Name "mystorageaccount" ``` This command gets NetworkRule property of a specified Storage account diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md index 6cef94a55123..595bb3dc4e10 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md @@ -52,19 +52,17 @@ The **Get-AzStorageBlob** cmdlet lists blobs in the specified container in an Az ## EXAMPLES ### Example 1: Get a blob by blob name -``` -PS C:\>Get-AzStorageBlob -Container "ContainerName" -Blob blob* +```powershell +Get-AzStorageBlob -Container "ContainerName" -Blob blob* ``` This command uses a blob name and wildcard to get a blob. ### Example 2: Get blobs in a container by using the pipeline - - - +```powershell +Get-AzStorageContainer -Name container* | Get-AzStorageBlob -IncludeDeleted ``` -PS C:\>Get-AzStorageContainer -Name container* | Get-AzStorageBlob -IncludeDeleted - +```output Container Uri: https://storageaccountname.blob.core.windows.net/container1 Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted @@ -77,19 +75,19 @@ test2 BlockBlob 403116 application/octet-stream 20 This command uses the pipeline to get all blobs (include blobs in Deleted status) in a container. ### Example 3: Get blobs by name prefix -``` -PS C:\>Get-AzStorageBlob -Container "ContainerName" -Prefix "blob" +```powershell +Get-AzStorageBlob -Container "ContainerName" -Prefix "blob" ``` This command uses a name prefix to get blobs. ### Example 4: List blobs in multiple batches -``` -PS C:\>$MaxReturn = 10000 -PS C:\> $ContainerName = "abc" -PS C:\> $Total = 0 -PS C:\> $Token = $Null -PS C:\> do +```powershell +$MaxReturn = 10000 +$ContainerName = "abc" +$Total = 0 +$Token = $Null +do { $Blobs = Get-AzStorageBlob -Container $ContainerName -MaxCount $MaxReturn -ContinuationToken $Token $Total += $Blobs.Count @@ -97,7 +95,7 @@ PS C:\> do $Token = $Blobs[$blobs.Count -1].ContinuationToken; } While ($null -ne $Token) -PS C:\> Echo "Total $Total blobs in container $ContainerName" +Echo "Total $Total blobs in container $ContainerName" ``` This example uses the *MaxCount* and *ContinuationToken* parameters to list Azure Storage blobs in multiple batches. @@ -109,12 +107,10 @@ For more information, type `Get-Help About_Do`. The final command uses the **Echo** command to display the total. ### Example 5: Get all blobs in a container include blob version - - - +```powershell +Get-AzStorageBlob -Container "containername" -IncludeVersion ``` -PS C:\>Get-AzStorageBlob -Container "containername" -IncludeVersion - +```output AccountName: storageaccountname, ContainerName: containername Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -129,12 +125,10 @@ blob2 BlockBlob 2097152 application/octet-stream 20 This command gets all blobs in a container include blob version. ### Example 6: Get a single blob version - - - +```powershell +Get-AzStorageBlob -Container "containername" -Blob blob2 -VersionId "2020-07-03T16:19:16.2883167Z" ``` -PS C:\> Get-AzStorageBlob -Container "containername" -Blob blob2 -VersionId "2020-07-03T16:19:16.2883167Z" - +```output AccountName: storageaccountname, ContainerName: containername Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -145,12 +139,10 @@ blob2 BlockBlob 2097152 application/octet-stream 20 This command gets a single blobs verion with VersionId. ### Example 7: Get a single blob snapshot - - - +```powershell +Get-AzStorageBlob -Container "containername" -Blob blob1 -SnapshotTime "2020-07-06T06:56:06.8588431Z" ``` -PS C:\> Get-AzStorageBlob -Container "containername" -Blob blob1 -SnapshotTime "2020-07-06T06:56:06.8588431Z" - +```output AccountName: storageaccountname, ContainerName: containername Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -187,12 +179,10 @@ tag2 value2 This command lists blobs from a container with blob tags, and show the tags of the first blob. ### Example 9: Get a single blob with blob tag condition - - - +```powershell +Get-AzStorageBlob -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" ``` -PS C:\> Get-AzStorageBlob -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" - +```output AccountName: storageaccountname, ContainerName: containername Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md index f2ea29513e9a..436a72551957 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md @@ -25,12 +25,10 @@ The **Get-AzStorageBlobByTag** cmdlet lists blobs in a storage account across co ## EXAMPLES ### Example 1: List all blobs match a specific blob tag, across containers. - - - +```powershell +Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -Context $ctx ``` -PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -Context $ctx - +```output AccountName: storageaccountname, ContainerName: containername1 Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -49,12 +47,10 @@ testblob4 This command lists all blobs in a storage account, which contains a tag with name "tag1" and value "value1". ### Example 2: List blobs in a specific container and match a specific blob tag - - - +```powershell +Get-AzStorageBlobByTag -Container 'containername' -TagFilterSqlExpression """tag1""='value1'" -Context $ctx ``` -PS C:\> Get-AzStorageBlobByTag -Container 'containername' -TagFilterSqlExpression """tag1""='value1'" -Context $ctx - +```output AccountName: storageaccountname, ContainerName: containername Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -66,12 +62,10 @@ test2 This command lists blobs in a container and match a specific blob tag. ### Example 3: List all blobs match a specific blob tag, across containers, and get the blob properties. - - - +```powershell +Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -GetBlobProperty ``` -PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -GetBlobProperty - +```output AccountName: storageaccountname, ContainerName: containername1 Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobContent.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobContent.md index 1de2e4457648..0124cb8567b2 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobContent.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobContent.md @@ -54,37 +54,37 @@ If the blob name is not valid for the local computer, this cmdlet automatically ## EXAMPLES ### Example 1: Download blob content by name -``` -PS C:\>Get-AzStorageBlobContent -Container "ContainerName" -Blob "Blob" -Destination "C:\test\" +```powershell +Get-AzStorageBlobContent -Container "ContainerName" -Blob "Blob" -Destination "C:\test\" ``` This command downloads a blob by name. ### Example 2: Download blob content using the pipeline -``` -PS C:\>Get-AzStorageBlob -Container containername -Blob blobname | Get-AzStorageBlobContent +```powershell +Get-AzStorageBlob -Container containername -Blob blobname | Get-AzStorageBlobContent ``` This command uses the pipeline to find and download blob content. ### Example 3: Download blob content using the pipeline and a wildcard character -``` -PS C:\>Get-AzStorageContainer container* | Get-AzStorageBlobContent -Blob "cbox.exe" -Destination "C:\test" +```powershell +Get-AzStorageContainer container* | Get-AzStorageBlobContent -Blob "cbox.exe" -Destination "C:\test" ``` This example uses the asterisk wildcard character and the pipeline to find and download blob content. ### Example 4: Get a blob object and save it in a variable, then download blob content with the blob object -``` -PS C:\>$blob = Get-AzStorageBlob -Container containername -Blob blobname -PS C:\>Get-AzStorageBlobContent -CloudBlob $blob.ICloudBlob -Destination "C:\test" +```powershell +$blob = Get-AzStorageBlob -Container containername -Blob blobname +Get-AzStorageBlobContent -CloudBlob $blob.ICloudBlob -Destination "C:\test" ``` This example first get a blob object and save it in a variable, then download blob content with the blob object. ### Example 5: Download a blob content with blob Uri -``` -PS C:\>Get-AzStorageBlobContent -Uri $blobUri -Destination "C:\test" -Force +```powershell +Get-AzStorageBlobContent -Uri $blobUri -Destination "C:\test" -Force ``` This example will download a blob content with Uri, the Uri can be a Uri with Sas token. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobCopyState.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobCopyState.md index b5baa1c5f787..1c3ea9496b76 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobCopyState.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobCopyState.md @@ -41,33 +41,33 @@ It should run on the copy destination blob. ## EXAMPLES ### Example 1: Get the copy status of a blob -``` -C:\PS>Get-AzStorageBlobCopyState -Blob "ContosoPlanning2015" -Container "ContosoUploads" +```powershell +Get-AzStorageBlobCopyState -Blob "ContosoPlanning2015" -Container "ContosoUploads" ``` This command gets the copy status of the blob named ContosoPlanning2015 in the container ContosoUploads. ### Example 2: Get the copy status for of a blob by using the pipeline -``` -C:\PS>Get-AzStorageBlob -Blob "ContosoPlanning2015" -Container "ContosoUploads" | Get-AzStorageBlobCopyState +```powershell +Get-AzStorageBlob -Blob "ContosoPlanning2015" -Container "ContosoUploads" | Get-AzStorageBlobCopyState ``` This command gets the blob named ContosoPlanning2015 in the container named ContosoUploads by using the **Get-AzStorageBlob** cmdlet, and then passes the result to the current cmdlet by using the pipeline operator. The **Get-AzStorageBlobCopyState** cmdlet gets the copy status for that blob. ### Example 3: Get the copy status for a blob in a container by using the pipeline -``` -C:\PS>Get-AzStorageContainer -Name "ContosoUploads" | Get-AzStorageBlobCopyState -Blob "ContosoPlanning2015" +```powershell +Get-AzStorageContainer -Name "ContosoUploads" | Get-AzStorageBlobCopyState -Blob "ContosoPlanning2015" ``` This command gets the container named by using the **Get-AzStorageBlob** cmdlet, and then passes the result to the current cmdlet. The **Get-AzStorageContainer** cmdlet gets the copy status for the blob named ContosoPlanning2015 in that container. ### Example 4: Start Copy and pipeline to get the copy status -``` -C:\PS> $destBlob = Start-AzStorageBlobCopy -SrcContainer "contosouploads" -SrcBlob "ContosoPlanning2015" -DestContainer "contosouploads2" -DestBlob "ContosoPlanning2015_copy" +```powershell +$destBlob = Start-AzStorageBlobCopy -SrcContainer "contosouploads" -SrcBlob "ContosoPlanning2015" -DestContainer "contosouploads2" -DestBlob "ContosoPlanning2015_copy" -C:\PS> $destBlob | Get-AzStorageBlobCopyState +$destBlob | Get-AzStorageBlobCopyState ``` The first command starts copy blob "ContosoPlanning2015" to "ContosoPlanning2015_copy", and output the destiantion blob object. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md index 1f6c8d84efa0..a4c7adeb376b 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md @@ -50,18 +50,19 @@ The **Get-AzStorageBlobQueryResult** cmdlet applies a simple Structured Query La ## EXAMPLES ### Example 1: Query a blob - ```powershell -PS C:\> $inputconfig = New-AzStorageBlobQueryConfig -AsCsv -HasHeader +$inputconfig = New-AzStorageBlobQueryConfig -AsCsv -HasHeader -PS C:\> $outputconfig = New-AzStorageBlobQueryConfig -AsJson +$outputconfig = New-AzStorageBlobQueryConfig -AsJson -PS C:\> $queryString = "SELECT * FROM BlobStorage WHERE Name = 'a'" +$queryString = "SELECT * FROM BlobStorage WHERE Name = 'a'" -PS C:\> $result = Get-AzStorageBlobQueryResult -Container $containerName -Blob $blobName -QueryString $queryString -ResultFile "c:\resultfile.json" -InputTextConfiguration $inputconfig -OutputTextConfiguration $outputconfig -Context $ctx +$result = Get-AzStorageBlobQueryResult -Container $containerName -Blob $blobName -QueryString $queryString -ResultFile "c:\resultfile.json" -InputTextConfiguration $inputconfig -OutputTextConfiguration $outputconfig -Context $ctx -PS C:\> $result +$result +``` +```output BytesScanned FailureCount BlobQueryError ------------ ------------ -------------- 449 0 diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md index 8f008ff9be87..5973506bd677 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md @@ -36,10 +36,10 @@ The **Get-AzStorageBlobServiceProperty** cmdlet gets the service properties for ## EXAMPLES ### Example 1: Get Azure Storage Blob services property of a specified Storage Account - ```powershell -PS C:\> Get-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" - +Get-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup DefaultServiceVersion : diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md index 3ac7a4f735a8..1c44415cea2a 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md @@ -42,10 +42,10 @@ The **Get-AzStorageBlobTag** gets blob tags of a specific blob. ## EXAMPLES ### Example 1: Get blob tags on a specific blob - +```powershell +Get-AzStorageBlobTag -Container "containername" -Blob testblob ``` -PS C:\> Get-AzStorageBlobTag -Container "containername" -Blob testblob - +```output Name Value ---- ----- tag1 value1 @@ -55,10 +55,10 @@ tag2 value2 This command gets blob tags on a specific blob. ### Example 2: Get blob tags on a specific blob with tag condition - +```powershell +Get-AzStorageBlobTag -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" ``` -PS C:\> Get-AzStorageBlobTag -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" - +```output Name Value ---- ----- tag1 value1 diff --git a/src/Storage/Storage.Management/help/Get-AzStorageCORSRule.md b/src/Storage/Storage.Management/help/Get-AzStorageCORSRule.md index 9771dee17aab..1ccdced8d0c8 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageCORSRule.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageCORSRule.md @@ -25,8 +25,8 @@ The **Get-AzStorageCORSRule** cmdlet gets Cross-Origin Resource Sharing (CORS) r ## EXAMPLES ### Example 1: Get CORS rules of blob service -``` -PS C:\>Get-AzStorageCORSRule -ServiceType Blob +```powershell +Get-AzStorageCORSRule -ServiceType Blob ``` This command gets the CORS rules for the Blob service type. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageContainer.md b/src/Storage/Storage.Management/help/Get-AzStorageContainer.md index 06ef52c45f0c..3b8c1d12da80 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageContainer.md @@ -35,15 +35,15 @@ The **Get-AzStorageContainer** cmdlet lists the storage containers associated wi ## EXAMPLES ### Example 1: Get Azure Storage container by name -``` -PS C:\>Get-AzStorageContainer -Name container* +```powershell +Get-AzStorageContainer -Name container* ``` This example uses a wildcard character to return a list of all containers with a name that starts with container. ### Example 2: Get Azure Storage container by container name prefix -``` -PS C:\>Get-AzStorageContainer -Prefix "container" +```powershell +Get-AzStorageContainer -Prefix "container" ``` This example uses the *Prefix* parameter to return a list of all containers with a name that starts with container. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageContainerStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageContainerStoredAccessPolicy.md index 158479e6ec9d..a77837fe0572 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageContainerStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageContainerStoredAccessPolicy.md @@ -25,15 +25,15 @@ The **Get-AzStorageContainerStoredAccessPolicy** cmdlet lists the stored access ## EXAMPLES ### Example 1: Get a stored access policy in a storage container -``` -PS C:\>Get-AzStorageContainerStoredAccessPolicy -Container "Container07" -Policy "Policy22" +```powershell +Get-AzStorageContainerStoredAccessPolicy -Container "Container07" -Policy "Policy22" ``` This command gets the access policy named Policy22 in the storage container named Container07. ### Example 2: Get all the stored access policies in a storage container -``` -PS C:\>Get-AzStorageContainerStoredAccessPolicy -Container "Container07" +```powershell +Get-AzStorageContainerStoredAccessPolicy -Container "Container07" ``` This command gets all access policies in the storage container named Container07. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md index dad5490dab3c..53be3eff0eb2 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md @@ -32,10 +32,10 @@ The **Get-AzStorageEncryptionScope** cmdlet gets or lists encryption scopes from ## EXAMPLES ### Example 1: Get a single encryption scope - +```powershell +Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName $scopename ``` -PS C:\> Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName $scopename - +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFile.md b/src/Storage/Storage.Management/help/Get-AzStorageFile.md index f3e6a5eda9f9..492d32d6c4d1 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFile.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFile.md @@ -43,16 +43,16 @@ You can use the **IsDirectory** property to distinguish between folders and file ## EXAMPLES ### Example 1: List directories in a share -``` -PS C:\>Get-AzStorageFile -ShareName "ContosoShare06" | Where-Object {$_.GetType().Name -eq "AzureStorageFileDirectory"} +```powershell +Get-AzStorageFile -ShareName "ContosoShare06" | Where-Object {$_.GetType().Name -eq "AzureStorageFileDirectory"} ``` This command lists only the directories in the share ContosoShare06. It first retrieves both files and directories, passes them to the **where** operator by using the pipeline operator, then discards any objects whose type is not "AzureStorageFileDirectory". ### Example 2: List a File Directory -``` -PS C:\> Get-AzStorageFile -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" | Get-AzStorageFile +```powershell +Get-AzStorageFile -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" | Get-AzStorageFile ``` This command lists the files and folders in the directory ContosoWorkingFolder under the share ContosoShare06. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileContent.md b/src/Storage/Storage.Management/help/Get-AzStorageFileContent.md index 8b577d3a35c4..33daa2121d37 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileContent.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileContent.md @@ -52,22 +52,22 @@ This cmdlet does not return the contents of the file. ## EXAMPLES ### Example 1: Download a file from a folder -``` -PS C:\>Get-AzStorageFileContent -ShareName "ContosoShare06" -Path "ContosoWorkingFolder/CurrentDataFile" +```powershell +Get-AzStorageFileContent -ShareName "ContosoShare06" -Path "ContosoWorkingFolder/CurrentDataFile" ``` This command downloads a file that is named CurrentDataFile in the folder ContosoWorkingFolder from the file share ContosoShare06 to current folder. ### Example 2: Downloads the files under sample file share -``` -PS C:\>Get-AzStorageFile -ShareName sample | Where-Object {$_.GetType().Name -eq "CloudFile"} | Get-AzStorageFileContent +```powershell +Get-AzStorageFile -ShareName sample | Where-Object {$_.GetType().Name -eq "CloudFile"} | Get-AzStorageFileContent ``` This example downloads the files under sample file share ### Example 3: Download an Azure file to a local file, and perserve the Azure File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the local file. -``` -PS C:\>Get-AzStorageFileContent -ShareName sample -Path "dir1/file1" -Destination $localFilePath -PreserveSMBAttribute +```powershell +Get-AzStorageFileContent -ShareName sample -Path "dir1/file1" -Destination $localFilePath -PreserveSMBAttribute ``` This example downloads an Azure file to a local file, and perserves the Azure File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the local file. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileCopyState.md b/src/Storage/Storage.Management/help/Get-AzStorageFileCopyState.md index d1c03b4c6725..a6d8b7ae0395 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileCopyState.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileCopyState.md @@ -34,17 +34,17 @@ It should run on the copy destination file. ## EXAMPLES ### Example 1: Get the copy state by file name -``` -PS C:\>Get-AzStorageFileCopyState -ShareName "ContosoShare" -FilePath "ContosoFile" +```powershell +Get-AzStorageFileCopyState -ShareName "ContosoShare" -FilePath "ContosoFile" ``` This command gets the state of the copy operation for a file that has the specified name. ### Example 2: Start Copy and pipeline to get the copy status -``` -C:\PS> $destfile = Start-AzStorageFileCopy -SrcShareName "contososhare" -SrcFilePath "contosofile" -DestShareName "contososhare2" -destfilepath "contosofile_copy" +```powershell +$destfile = Start-AzStorageFileCopy -SrcShareName "contososhare" -SrcFilePath "contosofile" -DestShareName "contososhare2" -destfilepath "contosofile_copy" -C:\PS> $destfile | Get-AzStorageFileCopyState +$destfile | Get-AzStorageFileCopyState ``` The first command starts copy file "contosofile" to "contosofile_copy", and output the destiantion file object. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md b/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md index 83b6c06fe342..29339216acd2 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md @@ -49,10 +49,10 @@ The **Get-AzStorageFileHandle** cmdlet lists file handles of a file share, or f ## EXAMPLES ### Example 1: List all file handles on a file share recursively, and sort by ClientIp and OpenTime - +```powershell +Get-AzStorageFileHandle -ShareName "mysharename" -Recursive | Sort-Object ClientIP,OpenTime ``` -PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Recursive | Sort-Object ClientIP,OpenTime - +```output HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId -------- ---- -------- ---------- -------- ----------------- ------ -------- --------- 28506980357 104.46.105.229 49805 2019-07-29 08:37:36Z 0 0 9297571480349046273 @@ -66,10 +66,10 @@ HandleId Path ClientIp ClientPort OpenTime This command lists file handles on a file share, and sort the output by ClientIp, then by OpenTime. ### Example 2: List first 2 file handles on a file directory recursively - +```powershell +Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -First 2 ``` -PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -First 2 - +```output HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId -------- ---- -------- ---------- -------- ----------------- ------ -------- --------- 24057151779 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049 @@ -79,10 +79,10 @@ HandleId Path ClientIp ClientPort OpenTime LastReconne This command lists first 2 file handles on a file directory recursively . ### Example 3: List the 3rd to the 6th file handles on a file - +```powershell +Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -skip 2 -First 4 ``` -PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -skip 2 -First 4 - +```output HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId -------- ---- -------- ---------- -------- ----------------- ------ -------- --------- 24055513248 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321 diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md index 579d74b6bf29..4c308f7f00ee 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md @@ -36,10 +36,10 @@ The **Get-AzStorageFileServiceProperty** cmdlet gets the service properties for ## EXAMPLES ### Example 1: Get Azure Storage File services property of a specified Storage Account - ```powershell -PS C:\> Get-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" - +Get-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup ShareDeleteRetentionPolicy.Enabled : True diff --git a/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md index 4907f73d7b1a..21f8ee1c955b 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md @@ -51,12 +51,12 @@ d3d39a01-8d92-40e5-849f-e56209ae5cf5 src1 dest1 {} This command gets an object replication policy with specific policy Id and show its rules. ### Example 2:List object replication policy from a Storage account - -``` -PS C:\> $policies = Get-AzStorageObjectReplicationPolicy -ResourceGroupName "myresourcegroup" -AccountName "mydestaccount" - -PS C:\> $policies +```powershell +$policies = Get-AzStorageObjectReplicationPolicy -ResourceGroupName "myresourcegroup" -AccountName "mydestaccount" +$policies +``` +```output ResourceGroupName StorageAccountName PolicyId EnabledTime SourceAccount DestinationAccount Rules ----------------- ------------------ -------- ----------- ------------- ------------------ ----- myresourcegroup mydestaccount 56bfa11c-81ef-4f8d-b307-5e5386e16fba mysrcaccount1 mydestaccount [5fa8b1d6-4985-4abd-a0b3-ec4d07295a43,...] diff --git a/src/Storage/Storage.Management/help/Get-AzStorageQueue.md b/src/Storage/Storage.Management/help/Get-AzStorageQueue.md index 8ad966fc15e1..c085de24058e 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageQueue.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageQueue.md @@ -31,22 +31,22 @@ The **Get-AzStorageQueue** cmdlet lists storage queues associated with an Azure ## EXAMPLES ### Example 1: List all Azure Storage queues -``` -PS C:\>Get-AzStorageQueue +```powershell +Get-AzStorageQueue ``` This command gets a list of all storage queues for the current Storage account. ### Example 2: List Azure Storage queues using a wildcard character -``` -PS C:\>Get-AzStorageQueue -Name queue* +```powershell +Get-AzStorageQueue -Name queue* ``` This command uses a wildcard character to get a list of storage queues whose name starts with queue. ### Example 3: List Azure Storage queues using queue name prefix -``` -PS C:\>Get-AzStorageQueue -Prefix "queue" +```powershell +Get-AzStorageQueue -Prefix "queue" ``` This example uses the *Prefix* parameter to get a list of storage queues whose name starts with queue. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageQueueStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageQueueStoredAccessPolicy.md index ca9ef7ae125c..2b331403f9cf 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageQueueStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageQueueStoredAccessPolicy.md @@ -24,15 +24,15 @@ The **Get-AzStorageQueueStoredAccessPolicy** cmdlet lists the stored access poli ## EXAMPLES ### Example 1: Get a stored access policy in the queue -``` -PS C:\>Get-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy12" +```powershell +Get-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy12" ``` This command gets the access policy named Policy12 in the storage queue named MyQueue. ### Example 2: Get all stored access policies in the queue -``` -PS C:\>Get-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" +```powershell +Get-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" ``` This command gets all stored access policies in the queue named MyQueue. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageServiceLoggingProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageServiceLoggingProperty.md index 936b785fe406..6cb012842f59 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageServiceLoggingProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageServiceLoggingProperty.md @@ -24,8 +24,8 @@ The **Get-AzStorageServiceLoggingProperty** cmdlet gets logging properties for A ## EXAMPLES ### Example 1: Get logging properties for the Blob service -``` -C:\PS>Get-AzStorageServiceLoggingProperty -ServiceType Blob +```powershell +Get-AzStorageServiceLoggingProperty -ServiceType Blob ``` This command gets logging properties for blob storage. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageServiceMetricsProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageServiceMetricsProperty.md index 51e0e23a0194..8b27d60b57a5 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageServiceMetricsProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageServiceMetricsProperty.md @@ -24,8 +24,8 @@ The **Get-AzStorageServiceMetricsProperty** cmdlet gets metrics properties for t ## EXAMPLES ### Example 1: Get metrics properties for the Blob service -``` -C:\PS>Get-AzStorageServiceMetricsProperty -ServiceType Blob -MetricsType Hour +```powershell +Get-AzStorageServiceMetricsProperty -ServiceType Blob -MetricsType Hour ``` This command gets metrics properties for blob storage for the Hour metrics type. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md index 38ebecd1a932..e1f282142c0a 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md @@ -23,10 +23,10 @@ The **Get-AzStorageServiceProperty** cmdlet gets the properties for Azure Storag ## EXAMPLES ### Example 1: Get Azure Storage services property of the Blob service - +```powershell +Get-AzStorageServiceProperty -ServiceType Blob ``` -C:\PS>Get-AzStorageServiceProperty -ServiceType Blob - +```output Logging.Version : 1.0 Logging.LoggingOperations : None Logging.RetentionDays : diff --git a/src/Storage/Storage.Management/help/Get-AzStorageShare.md b/src/Storage/Storage.Management/help/Get-AzStorageShare.md index 67730c0616d1..e190bff94379 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageShare.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageShare.md @@ -33,31 +33,31 @@ The **Get-AzStorageShare** cmdlet gets a list of file shares for a storage accou ## EXAMPLES ### Example 1: Get a file share -``` -PS C:\>Get-AzStorageShare -Name "ContosoShare06" +```powershell +Get-AzStorageShare -Name "ContosoShare06" ``` This command gets the file share named ContosoShare06. ### Example 2: Get all file shares that begin with a string -``` -PS C:\>Get-AzStorageShare -Prefix "Contoso" +```powershell +Get-AzStorageShare -Prefix "Contoso" ``` This command gets all file shares that have names that begin with Contoso. ### Example 3: Get all file shares in a specified context -``` -PS C:\>$Context = New-AzStorageContext -Local -PS C:\> Get-AzStorageShare -Context $Context +```powershell +$Context = New-AzStorageContext -Local +Get-AzStorageShare -Context $Context ``` The first command uses the **New-AzStorageContext** cmdlet to create a context by using the *Local* parameter, and then stores that context object in the $Context variable. The second command gets the file shares for the context object stored in $Context. ### Example 4: Get a file share snapshot with specific share name and SnapshotTime -``` -PS C:\>Get-AzStorageShare -Name "ContosoShare06" -SnapshotTime "6/16/2017 9:48:41 AM +00:00" +```powershell +Get-AzStorageShare -Name "ContosoShare06" -SnapshotTime "6/16/2017 9:48:41 AM +00:00" ``` This command gets a file share snapshot with specific share name and SnapshotTime. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageShareStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageShareStoredAccessPolicy.md index a44554959414..55ba31574eca 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageShareStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageShareStoredAccessPolicy.md @@ -26,15 +26,15 @@ To get a particular policy, specify it by name. ## EXAMPLES ### Example 1: Get a stored access policy in a share -``` -PS C:\>Get-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" +```powershell +Get-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" ``` This command gets a stored access policy named GeneralPolicy in ContosoShare. ### Example 2: Get all the stored access policies in share -``` -PS C:\>Get-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" +```powershell +Get-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" ``` This command gets all stored access policies in ContosoShare. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageTable.md b/src/Storage/Storage.Management/help/Get-AzStorageTable.md index 0324f0477091..ea257df9d389 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageTable.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageTable.md @@ -31,22 +31,22 @@ The **Get-AzStorageTable** cmdlet lists the storage tables associated with the s ## EXAMPLES ### Example 1: List all Azure Storage tables -``` -PS C:\>Get-AzStorageTable +```powershell +Get-AzStorageTable ``` This command gets all storage tables for a Storage account. ### Example 2: List Azure Storage tables using a wildcard character -``` -PS C:\>Get-AzStorageTable -Name table* +```powershell +Get-AzStorageTable -Name table* ``` This command uses a wildcard character to get storage tables whose name starts with table. ### Example 3: List Azure Storage tables using table name prefix -``` -PS C:\>Get-AzStorageTable -Prefix "table" +```powershell +Get-AzStorageTable -Prefix "table" ``` This command uses the *Prefix* parameter to get storage tables whose name starts with table. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageTableStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageTableStoredAccessPolicy.md index b86d405bbaa7..02fa1294416f 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageTableStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageTableStoredAccessPolicy.md @@ -24,15 +24,15 @@ The **Get-AzStorageTableStoredAccessPolicy** cmdlet lists the stored access poli ## EXAMPLES ### Example 1: Get a stored access policy in a storage table -``` -PS C:\>Get-AzStorageTableStoredAccessPolicy -Table "Table02" -Policy "Policy50" +```powershell +Get-AzStorageTableStoredAccessPolicy -Table "Table02" -Policy "Policy50" ``` This command gets the access policy named Policy50 in the storage table named Table02. ### Example 2: Get all stored access policies in a storage table -``` -PS C:\>Get-AzStorageTableStoredAccessPolicy -Table "Table02" +```powershell +Get-AzStorageTableStoredAccessPolicy -Table "Table02" ``` This command gets all access policies in the table named Table02. diff --git a/src/Storage/Storage.Management/help/Get-AzStorageUsage.md b/src/Storage/Storage.Management/help/Get-AzStorageUsage.md index 3089f11993c9..7938b1a8b0d4 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageUsage.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageUsage.md @@ -23,10 +23,10 @@ The **Get-AzStorageUsage** cmdlet gets the resource usage for Azure Storage for ## EXAMPLES ### Example 1: Get the storage resources usage of specified location - +```powershell +Get-AzStorageUsage -Location 'West US' ``` -PS C:\>Get-AzStorageUsage -Location 'West US' - +```output LocalizedName : Storage Accounts Name : StorageAccounts Unit : Count diff --git a/src/Storage/Storage.Management/help/Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration.md b/src/Storage/Storage.Management/help/Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration.md index 6c24f7585b31..f6c6910de59f 100644 --- a/src/Storage/Storage.Management/help/Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration.md +++ b/src/Storage/Storage.Management/help/Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration.md @@ -39,10 +39,10 @@ The cmdlet only works when the Storage account has already enabled blob versioni ## EXAMPLES ### Example 1: Migrates an existing Storage blob containers to enable immutable Storage with versioning. -``` -PS C:\> $t = Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -asjob +```powershell +$t = Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -asjob -PS C:\> $t | Wait-Job +$t | Wait-Job ``` This command migrates an existing Storage blob containers to enable immutable Storage with versioning. diff --git a/src/Storage/Storage.Management/help/Lock-AzRmStorageContainerImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Lock-AzRmStorageContainerImmutabilityPolicy.md index e3c663c22525..d94f9554eb75 100644 --- a/src/Storage/Storage.Management/help/Lock-AzRmStorageContainerImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Lock-AzRmStorageContainerImmutabilityPolicy.md @@ -43,34 +43,34 @@ The **Lock-AzRmStorageContainerImmutabilityPolicy** cmdlet locks ImmutabilityPol ## EXAMPLES ### Example 1: Lock ImmutabilityPolicy of a Storage blob container with Storage account name and container name -``` -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Etag $policy.Etag +```powershell +$policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" +Lock-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Etag $policy.Etag ``` This command Locks ImmutabilityPolicy of a Storage blob container with Storage account name and container name. ### Example 2: Lock ImmutabilityPolicy of a Storage blob container, with Storage account object -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -Etag $policy.Etag -Force +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" +Lock-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -Etag $policy.Etag -Force ``` This command locks ImmutabilityPolicy of a Storage blob container, with Storage account object. ### Example 3: Lock ImmutabilityPolicyof a Storage blob container, with container object -``` -PS C:\>$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -PS C:\>Lock-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -Etag $policy.Etag -Force +```powershell +$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" +$policy = Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject +Lock-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -Etag $policy.Etag -Force ``` This command locks ImmutabilityPolicy of a Storage blob container with Storage container object. ### Example 4: Lock ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object -``` -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Lock-AzRmStorageContainerImmutabilityPolicy -Force +```powershell +Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Lock-AzRmStorageContainerImmutabilityPolicy -Force ``` This command locks ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object. diff --git a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md index 3defc6005959..cb22d3b1ab93 100644 --- a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md @@ -33,10 +33,11 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Move a fold in same Filesystem - +```powershell +Move-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" -DestFileSystem "filesystem1" -DestPath "dir3/" ``` -PS C:\> Move-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" -DestFileSystem "filesystem1" -DestPath "dir3/" +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -47,10 +48,11 @@ dir3 True 2020-03-13 13:07:34Z rwxrw-rw- This command move directory 'dir1' to directory 'dir3' in the same Filesystem. ### Example 2: Move a file by pipeline, to another Filesystem in the same Storage account without prompt - +```powershell +Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Move-AzDataLakeGen2Item -DestFileSystem "filesystem2" -DestPath "dir2/file2" -Force ``` -PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Move-AzDataLakeGen2Item -DestFileSystem "filesystem2" -DestPath "dir2/file2" -Force +```output FileSystem Name: filesystem2 Path IsDirectory Length LastModified Permissions Owner Group @@ -61,14 +63,15 @@ dir2/file2 False 1024 2020-03-23 09:57:33Z rwxrw-rw- This command move file 'dir1/file1' in 'filesystem1' to file 'dir2/file2' in 'filesystem2' in the same Storage account without prompt. ### Example 3: Move an item with Sas token - -``` -PS C:\> $sas = New-AzStorageContainerSASToken -Name $filesystemName -Permission rdw -Context $ctx +```powershell +$sas = New-AzStorageContainerSASToken -Name $filesystemName -Permission rdw -Context $ctx -PS C:\> $sasctx = New-AzStorageContext -StorageAccountName $ctx.StorageAccountName -SasToken $sas +$sasctx = New-AzStorageContext -StorageAccountName $ctx.StorageAccountName -SasToken $sas -PS C:\> Move-AzDataLakeGen2Item -FileSystem $filesystemName -Path $itempath1 -DestFileSystem $filesystemName -DestPath "$($itempath2)$($sas)" -Context $sasctx +Move-AzDataLakeGen2Item -FileSystem $filesystemName -Path $itempath1 -DestFileSystem $filesystemName -DestPath "$($itempath2)$($sas)" -Context $sasctx +``` +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md index 5bc8363fe466..4eb552167673 100644 --- a/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md @@ -35,10 +35,11 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Create a directory with specified permission, Umask, properties, and metadata - +```powershell +New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/" -Directory -Permission rwxrwxrwx -Umask ---rw---- -Property @{"CacheControl" = "READ"; "ContentDisposition" = "True"} -Metadata @{"tag1" = "value1"; "tag2" = "value2" } ``` -PS C:\>New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/" -Directory -Permission rwxrwxrwx -Umask ---rw---- -Property @{"CacheControl" = "READ"; "ContentDisposition" = "True"} -Metadata @{"tag1" = "value1"; "tag2" = "value2" } +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -49,12 +50,12 @@ dir1/dir2 True 2020-03-23 09:15:56Z rwx---rwx This command creates a directory with specified Permission, Umask, properties, and metadata ### Example 2: Create(upload) a data lake file from a local source file, and the cmdlet runs in background - +```powershell +$task = New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/file1" -Source "c:\sourcefile.txt" -Force -asjob +$task | Wait-Job +$task.Output ``` -PS C:\> $task = New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/file1" -Source "c:\sourcefile.txt" -Force -asjob -PS C:\> $task | Wait-Job -PS C:\> $task.Output - +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/New-AzDataLakeGen2SasToken.md b/src/Storage/Storage.Management/help/New-AzDataLakeGen2SasToken.md index b2f270711e08..047c85dfa189 100644 --- a/src/Storage/Storage.Management/help/New-AzDataLakeGen2SasToken.md +++ b/src/Storage/Storage.Management/help/New-AzDataLakeGen2SasToken.md @@ -34,14 +34,14 @@ The **New-AzDataLakeGen2SasToken** cmdlet generates a Shared Access Signature (S ## EXAMPLES ### Example 1: Generate a SAS token with full permission -``` +```powershell New-AzDataLakeGen2SasToken -FileSystem "filesystem1" -Path "dir1/dir2" -Permission racwdlmeop ``` This example generates a DatalakeGen2 SAS token with full permission. ### Example 2: Generate a SAS token with specific StartTime, ExpireTime, Protocal, IPAddressOrRange, Encryption Scope, by pipeline a datalakegen2 item -``` +```powershell Get-AzDataLakeGen2Item -FileSystem test -Path "testdir/dir2" | New-AzDataLakeGen2SasToken -Permission rw -Protocol Https -IPAddressOrRange 10.0.0.0-12.10.0.0 -StartTime (Get-Date) -ExpiryTime (Get-Date).AddDays(6) -EncryptionScope scopename ``` diff --git a/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md index 6c9de2ec1dc7..25db347f47a5 100644 --- a/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md @@ -48,16 +48,16 @@ The **New-AzRmStorageContainer** cmdlet creates a Storage blob container ## EXAMPLES ### Example 1: Create a Storage blob container with Storage account name and container name, with metadata -``` -PS C:\>New-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Metadata @{tag0="value0";tag1="value1";tag2="value2"} +```powershell +New-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Metadata @{tag0="value0";tag1="value1";tag2="value2"} ``` This command creates a Storage blob container with Storage account name and container name, with metadata. ### Example 2: Create a Storage blob container with Storage account object and container name, with public access as Blob -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>New-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" -PublicAccess Blob +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +New-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" -PublicAccess Blob ``` This command creates a Storage blob container with Storage account object and container name, with public access as Blob. @@ -100,11 +100,12 @@ False This command creates a storage container, with RootSquash property set as AllSquash. RootSquash only works on a storage account that enabled NfsV3. ### Example 5: Create a storage container and enable immutable Storage with versioning - -``` -PS C:\> $c = New-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -EnableImmutableStorageWithVersioning +```powershell +$c = New-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -EnableImmutableStorageWithVersioning -PS C:\> $c +$c +``` +```output ResourceGroupName: myResourceGroup, StorageAccountName: mystorageaccount diff --git a/src/Storage/Storage.Management/help/New-AzRmStorageShare.md b/src/Storage/Storage.Management/help/New-AzRmStorageShare.md index 74488f4eea82..e2d582d37ef5 100644 --- a/src/Storage/Storage.Management/help/New-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/New-AzRmStorageShare.md @@ -32,10 +32,10 @@ The **New-AzRmStorageShare** cmdlet creates a Storage file share. ## EXAMPLES ### Example 1: Create a Storage file share with Storage account name and share name, with metadata and share quota as 100 GiB. - +```powershell +New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -QuotaGiB 100 -Metadata @{"tag1" = "value1"; "tag2" = "value2" } ``` -PS C:\>New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -QuotaGiB 100 -Metadata @{"tag1" = "value1"; "tag2" = "value2" } - +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocol AccessTier Deleted Version ShareUsageBytes @@ -46,10 +46,10 @@ myshare This command creates a Storage file share with metadata and share quota as 100 GiB. ### Example 2: Create a Storage file share with Storage account object - -``` +```powershell Get-AzStorageAccount -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | New-AzRmStorageShare -Name "myshare" - +``` +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocol AccessTier Deleted Version ShareUsageBytes diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccount.md b/src/Storage/Storage.Management/help/New-AzStorageAccount.md index 8d9f66cfdeb3..bf72327ec828 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccount.md @@ -82,28 +82,28 @@ The **New-AzStorageAccount** cmdlet creates an Azure Storage account. ### Example 1: Create a Storage account ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS +New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS ``` This command creates a Storage account for the resource group name MyResourceGroup. ### Example 2: Create a Blob Storage account with BlobStorage Kind and hot AccessTier ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS -Kind BlobStorage -AccessTier Hot +New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS -Kind BlobStorage -AccessTier Hot ``` This command creates a Blob Storage account that with BlobStorage Kind and hot AccessTier ### Example 3: Create a Storage account with Kind StorageV2, and Generate and Assign an Identity for Azure KeyVault. ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS -Kind StorageV2 -AssignIdentity +New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -SkuName Standard_GRS -Kind StorageV2 -AssignIdentity ``` This command creates a Storage account with Kind StorageV2. It also generates and assigns an identity that can be used to manage account keys through Azure KeyVault. ### Example 4: Create a Storage account with NetworkRuleSet from JSON ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -Type Standard_LRS -NetworkRuleSet (@{bypass="Logging,Metrics"; +New-AzStorageAccount -ResourceGroupName MyResourceGroup -Name mystorageaccount -Location westus -Type Standard_LRS -NetworkRuleSet (@{bypass="Logging,Metrics"; ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"}, @{IPAddressOrRange="10.0.0.0/7";Action="allow"}); virtualNetworkRules=(@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"}, @@ -115,21 +115,21 @@ This command creates a Storage account that has NetworkRuleSet property from JSO ### Example 5: Create a Storage account with Hierarchical Namespace enabled, Sftp enabled, and localuser enabled. ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "mystorageaccount" -Location "US West" -SkuName "Standard_GRS" -Kind StorageV2 -EnableHierarchicalNamespace $true -EnableSftp $true -EnableLocalUser $true +New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "mystorageaccount" -Location "US West" -SkuName "Standard_GRS" -Kind StorageV2 -EnableHierarchicalNamespace $true -EnableSftp $true -EnableLocalUser $true ``` This command creates a Storage account with Hierarchical Namespace enabled, Sftp enabled, and localuser enabled. ### Example 6: Create a Storage account with Azure Files AAD DS Authentication, and enable large file share. ```powershell -PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableAzureActiveDirectoryDomainServicesForFile $true -EnableLargeFileShare +New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableAzureActiveDirectoryDomainServicesForFile $true -EnableLargeFileShare ``` This command creates a Storage account with Azure Files AAD DS Authentication, and enable large file share. ### Example 7: Create a Storage account with enable Files Active Directory Domain Service Authentication and DefaultSharePermission. -``` -PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableActiveDirectoryDomainServicesForFile $true ` +```powershell +New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableActiveDirectoryDomainServicesForFile $true ` -ActiveDirectoryDomainName "mydomain.com" ` -ActiveDirectoryNetBiosDomainName "mydomain.com" ` -ActiveDirectoryForestName "mydomain.com" ` @@ -291,27 +291,26 @@ LastKeyRotationTimestamp : 4/12/2021 8:17:57 AM This command first create a keyvault and a user assigned identity, then create a storage account with keyvault encryption (the storage access access keyvault with the user assigned identity). ### Example 13: Create account with EnableNfsV3 - - - -``` -PS C:\> $account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -EnableNfsV3 $true -EnableHierarchicalNamespace $true -EnableHttpsTrafficOnly $false -NetworkRuleSet (@{bypass="Logging,Metrics"; +```powershell +$account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -EnableNfsV3 $true -EnableHierarchicalNamespace $true -EnableHttpsTrafficOnly $false -NetworkRuleSet (@{bypass="Logging,Metrics"; virtualNetworkRules=(@{VirtualNetworkResourceId="$vnet1";Action="allow"}); defaultAction="deny"}) -PS C:\> $account.EnableNfsV3 +$account.EnableNfsV3 +``` +```output True ``` The command create account with EnableNfsV3 as true, and then show the EnableNfsV3 property of the created account ### Example 14: Create account with disable PublicNetworkAccess - +```powershell +$account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -PublicNetworkAccess Disabled +$account.PublicNetworkAccess ``` -PS C:\> $account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -PublicNetworkAccess Disabled - -PS C:\> $account.PublicNetworkAccess +```output Disabled ``` @@ -338,8 +337,8 @@ The command creates an account and enable account level immutability with versio The account is also created with a default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level. ### Example 16: Create a Storage account with enable Azure Files Active Directory Domain Service Kerberos Authentication. -``` -PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableAzureActiveDirectoryKerberosForFile $true ` +```powershell +New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EnableAzureActiveDirectoryKerberosForFile $true ` -ActiveDirectoryDomainName "mydomain.com" ` -ActiveDirectoryDomainGuid "12345678-1234-1234-1234-123456789012" ``` diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccountKey.md b/src/Storage/Storage.Management/help/New-AzStorageAccountKey.md index b53a7ed42706..262aee071768 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccountKey.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccountKey.md @@ -24,8 +24,8 @@ The **New-AzStorageAccountKey** cmdlet regenerates a storage key for an Azure St ## EXAMPLES ### Example 1: Regenerate a storage key -``` -PS C:\>New-AzStorageAccountKey -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyName "key1" +```powershell +New-AzStorageAccountKey -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyName "key1" ``` This command regenerates a storage key for the specified Storage account. diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccountSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageAccountSASToken.md index fb92ae707d1d..6bad5f91c799 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccountSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccountSASToken.md @@ -28,22 +28,22 @@ An account SAS is secured using the storage account key. To create an account SA ## EXAMPLES ### Example 1: Create an account-level SAS token with full permission -``` -PS C:\> New-AzStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" +```powershell +New-AzStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" ``` This command creates an account-level SAS token with full permission. ### Example 2: Create an account-level SAS token for a range of IP addresses and EncryptionScope -``` -PS C:\> New-AzStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" -Protocol HttpsOnly -IPAddressOrRange 168.1.5.60-168.1.5.70 -EncryptionScope scopename +```powershell +New-AzStorageAccountSASToken -Service Blob,File,Table,Queue -ResourceType Service,Container,Object -Permission "racwdlup" -Protocol HttpsOnly -IPAddressOrRange 168.1.5.60-168.1.5.70 -EncryptionScope scopename ``` This command creates an account-level SAS token for HTTPS-only requests from the specified range of IP addresses, with a specific EncryptionScope. ### Example 3: Create an account-level SAS token valid for 24 hours -``` -PS C:\> New-AzStorageAccountSASToken -Service Blob -ResourceType Service,Container,Object -Permission "rl" -ExpiryTime (Get-Date).AddDays(1) +```powershell +New-AzStorageAccountSASToken -Service Blob -ResourceType Service,Container,Object -Permission "rl" -ExpiryTime (Get-Date).AddDays(1) ``` This command creates an read-only account-level SAS token that is valid for 24 hours. diff --git a/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md b/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md index bfdf44c1d8a9..f22cb3623d5d 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md +++ b/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md @@ -29,18 +29,18 @@ The **New-AzStorageBlobQueryConfig** cmdlet creates a blob query configuration o ## EXAMPLES ### Example 1: Create blob query configures , and query a blob - ```powershell -PS C:\> $inputconfig = New-AzStorageBlobQueryConfig -AsCsv -ColumnSeparator "," -QuotationCharacter """" -EscapeCharacter "\" -RecordSeparator "`n" -HasHeader +$inputconfig = New-AzStorageBlobQueryConfig -AsCsv -ColumnSeparator "," -QuotationCharacter """" -EscapeCharacter "\" -RecordSeparator "`n" -HasHeader -PS C:\> $outputconfig = New-AzStorageBlobQueryConfig -AsJson -RecordSeparator "`n" +$outputconfig = New-AzStorageBlobQueryConfig -AsJson -RecordSeparator "`n" -PS C:\> $queryString = "SELECT * FROM BlobStorage WHERE Name = 'a'" +$queryString = "SELECT * FROM BlobStorage WHERE Name = 'a'" -PS C:\> $result = Get-AzStorageBlobQueryResult -Container $containerName -Blob $blobName -QueryString $queryString -ResultFile "c:\resultfile.json" -InputTextConfiguration $inputconfig -OutputTextConfiguration $outputconfig -Context $ctx - -PS C:\> $result +$result = Get-AzStorageBlobQueryResult -Container $containerName -Blob $blobName -QueryString $queryString -ResultFile "c:\resultfile.json" -InputTextConfiguration $inputconfig -OutputTextConfiguration $outputconfig -Context $ctx +$result +``` +```output BytesScanned FailureCount BlobQueryError ------------ ------------ -------------- 449 0 diff --git a/src/Storage/Storage.Management/help/New-AzStorageBlobRangeToRestore.md b/src/Storage/Storage.Management/help/New-AzStorageBlobRangeToRestore.md index f821c7d8afbe..34113cd132fb 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageBlobRangeToRestore.md +++ b/src/Storage/Storage.Management/help/New-AzStorageBlobRangeToRestore.md @@ -24,28 +24,28 @@ The **New-AzStorageBlobRangeToRestore** cmdlet creates a Blob range object, whic ### Example 1: Creates a blob range to restore ```powershell -PS C:\> $range = New-AzStorageBlobRangeToRestore -StartRange container1/blob1 -EndRange container2/blob2 +$range = New-AzStorageBlobRangeToRestore -StartRange container1/blob1 -EndRange container2/blob2 ``` This command creates a blob range to restore, which starts at container1/blob1 (include), and ends at container2/blob2 (exclude). ### Example 2: Creates a blob range which will restore from first blob in alphabetical order, to a specific blob (exclude) ```powershell -PS C:\> $range = New-AzStorageBlobRangeToRestore -StartRange "" -EndRange container2/blob2 +$range = New-AzStorageBlobRangeToRestore -StartRange "" -EndRange container2/blob2 ``` This command creates a blob range which will restore from first blob of alphabetical order, to a specific blob container2/blob2 (exclude) ### Example 3: Creates a blob range which will restore from a specific blob (include), to the last blob in alphabetical order ```powershell -PS C:\> $range = New-AzStorageBlobRangeToRestore -StartRange container1/blob1 -EndRange "" +$range = New-AzStorageBlobRangeToRestore -StartRange container1/blob1 -EndRange "" ``` This command creates a blob range which will restore from a specific blob container1/blob1 (include), to the last blob in alphabetical order. ### Example 4: Creates a blob range which will restore all blobs ```powershell -PS C:\> $range = New-AzStorageBlobRangeToRestore -StartRange "" -EndRange "" +$range = New-AzStorageBlobRangeToRestore -StartRange "" -EndRange "" ``` This command creates a blob range which will restore all blobs. diff --git a/src/Storage/Storage.Management/help/New-AzStorageBlobSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageBlobSASToken.md index f66f28265010..9675428b795d 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageBlobSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageBlobSASToken.md @@ -51,27 +51,27 @@ The **New-AzStorageBlobSASToken** cmdlet generates a Shared Access Signature (SA ## EXAMPLES ### Example 1: Generate a blob SAS token with full blob permission -``` -PS C:\>New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd +```powershell +New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd ``` This example generates a blob SAS token with full blob permission. ### Example 2: Generate a blob SAS token with life time -``` -PS C:\> $StartTime = Get-Date -PS C:\> $EndTime = $startTime.AddHours(2.0) -PS C:\> New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime +```powershell +$StartTime = Get-Date +$EndTime = $startTime.AddHours(2.0) +New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime ``` This example generates a blob SAS token with life time. ### Example 3: Generate a User Identity SAS token with storage context based on OAuth authentication -``` -PS C:\> $ctx = New-AzStorageContext -StorageAccountName $accountName -UseConnectedAccount -PS C:\> $StartTime = Get-Date -PS C:\> $EndTime = $startTime.AddDays(6) -PS C:\> New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime -Context $ctx +```powershell +$ctx = New-AzStorageContext -StorageAccountName $accountName -UseConnectedAccount +$StartTime = Get-Date +$EndTime = $startTime.AddDays(6) +New-AzStorageBlobSASToken -Container "ContainerName" -Blob "BlobName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime -Context $ctx ``` This example generates a User Identity blob SAS token with storage context based on OAuth authentication diff --git a/src/Storage/Storage.Management/help/New-AzStorageContainer.md b/src/Storage/Storage.Management/help/New-AzStorageContainer.md index fd255636e271..a21045e4b36f 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/New-AzStorageContainer.md @@ -34,15 +34,15 @@ The **New-AzStorageContainer** cmdlet creates an Azure storage container. ## EXAMPLES ### Example 1: Create an Azure storage container -``` -PS C:\>New-AzStorageContainer -Name "ContainerName" -Permission Off +```powershell +New-AzStorageContainer -Name "ContainerName" -Permission Off ``` This command creates a storage container. ### Example 2: Create multiple Azure storage containers -``` -PS C:\>"container1 container2 container3".split() | New-AzStorageContainer -Permission Container +```powershell +"container1 container2 container3".split() | New-AzStorageContainer -Permission Container ``` This example creates multiple storage containers. diff --git a/src/Storage/Storage.Management/help/New-AzStorageContainerSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageContainerSASToken.md index faef583417f1..3796dd4114ee 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageContainerSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageContainerSASToken.md @@ -35,32 +35,32 @@ The **New-AzStorageContainerSASToken** cmdlet generates a Shared Access Signatur ## EXAMPLES ### Example 1: Generate a container SAS token with full container permission -``` -PS C:\>New-AzStorageContainerSASToken -Name "Test" -Permission rwdl +```powershell +New-AzStorageContainerSASToken -Name "Test" -Permission rwdl ``` This example generates a container SAS token with full container permission. ### Example 2: Generate multiple container SAS token by pipeline -``` -PS C:\>Get-AzStorageContainer -Container test* | New-AzStorageContainerSASToken -Permission rwdl +```powershell +Get-AzStorageContainer -Container test* | New-AzStorageContainerSASToken -Permission rwdl ``` This example generates multiple container SAS tokens by using the pipeline. ### Example 3: Generate container SAS token with shared access policy -``` -PS C:\>New-AzStorageContainerSASToken -Name "Test" -Policy "PolicyName" +```powershell +New-AzStorageContainerSASToken -Name "Test" -Policy "PolicyName" ``` This example generates a container SAS token with shared access policy. ### Example 3: Generate a User Identity container SAS token with storage context based on OAuth authentication -``` -PS C:\> $ctx = New-AzStorageContext -StorageAccountName $accountName -UseConnectedAccount -PS C:\> $StartTime = Get-Date -PS C:\> $EndTime = $startTime.AddDays(6) -PS C:\> New-AzStorageContainerSASToken -Name "ContainerName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime -context $ctx +```powershell +$ctx = New-AzStorageContext -StorageAccountName $accountName -UseConnectedAccount +$StartTime = Get-Date +$EndTime = $startTime.AddDays(6) +New-AzStorageContainerSASToken -Name "ContainerName" -Permission rwd -StartTime $StartTime -ExpiryTime $EndTime -context $ctx ``` This example generates a User Identity container SAS token with storage context based on OAuth authentication diff --git a/src/Storage/Storage.Management/help/New-AzStorageContainerStoredAccessPolicy.md b/src/Storage/Storage.Management/help/New-AzStorageContainerStoredAccessPolicy.md index bfab98151f13..7cb96d5ee774 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageContainerStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/New-AzStorageContainerStoredAccessPolicy.md @@ -26,8 +26,8 @@ The **New-AzStorageContainerStoredAccessPolicy** cmdlet creates a stored access ## EXAMPLES ### Example 1: Create a stored access policy in a storage container -``` -PS C:\>New-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy01" +```powershell +New-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy01" ``` This command creates an access policy named Policy01 in the storage container named MyContainer. diff --git a/src/Storage/Storage.Management/help/New-AzStorageContext.md b/src/Storage/Storage.Management/help/New-AzStorageContext.md index 3ff9b611afda..6b0029e3cf05 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageContext.md +++ b/src/Storage/Storage.Management/help/New-AzStorageContext.md @@ -103,48 +103,48 @@ See details of authentication of the Storage Service in https://docs.microsoft.c ## EXAMPLES ### Example 1: Create a context by specifying a storage account name and key -``` -PS C:\>New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" +```powershell +New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" ``` This command creates a context for the account named ContosoGeneral that uses the specified key. ### Example 2: Create a context by specifying a connection string -``` -PS C:\>New-AzStorageContext -ConnectionString "DefaultEndpointsProtocol=https;AccountName=ContosoGeneral;AccountKey=< Storage Key for ContosoGeneral ends with == >;" +```powershell +New-AzStorageContext -ConnectionString "DefaultEndpointsProtocol=https;AccountName=ContosoGeneral;AccountKey=< Storage Key for ContosoGeneral ends with == >;" ``` This command creates a context based on the specified connection string for the account ContosoGeneral. ### Example 3: Create a context for an anonymous storage account -``` -PS C:\>New-AzStorageContext -StorageAccountName "ContosoGeneral" -Anonymous -Protocol "http" +```powershell +New-AzStorageContext -StorageAccountName "ContosoGeneral" -Anonymous -Protocol "http" ``` This command creates a context for anonymous use for the account named ContosoGeneral. The command specifies HTTP as a connection protocol. ### Example 4: Create a context by using the local development storage account -``` -PS C:\>New-AzStorageContext -Local +```powershell +New-AzStorageContext -Local ``` This command creates a context by using the local development storage account. The command specifies the *Local* parameter. ### Example 5: Get the container for the local developer storage account -``` -PS C:\>New-AzStorageContext -Local | Get-AzStorageContainer +```powershell +New-AzStorageContext -Local | Get-AzStorageContainer ``` This command creates a context by using the local development storage account, and then passes the new context to the **Get-AzStorageContainer** cmdlet by using the pipeline operator. The command gets the Azure Storage container for the local developer storage account. ### Example 6: Get multiple containers -``` -PS C:\>$Context01 = New-AzStorageContext -Local -PS C:\> $Context02 = New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -PS C:\> ($Context01, $Context02) | Get-AzStorageContainer +```powershell +$Context01 = New-AzStorageContext -Local +$Context02 = New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" +($Context01, $Context02) | Get-AzStorageContainer ``` The first command creates a context by using the local development storage account, and then stores that context in the $Context01 variable. @@ -152,26 +152,26 @@ The second command creates a context for the account named ContosoGeneral that u The final command gets the containers for the contexts stored in $Context01 and $Context02 by using **Get-AzStorageContainer**. ### Example 7: Create a context with an endpoint -``` -PS C:\>New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Endpoint "contosoaccount.core.windows.net" +```powershell +New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Endpoint "contosoaccount.core.windows.net" ``` This command creates an Azure Storage context that has the specified storage endpoint. The command creates the context for the account named ContosoGeneral that uses the specified key. ### Example 8: Create a context with a specified environment -``` -PS C:\>New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Environment "AzureChinaCloud" +```powershell +New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Environment "AzureChinaCloud" ``` This command creates an Azure storage context that has the specified Azure environment. The command creates the context for the account named ContosoGeneral that uses the specified key. ### Example 9: Create a context by using an SAS token -``` -PS C:\>$SasToken = New-AzStorageContainerSASToken -Name "ContosoMain" -Permission "rad" -PS C:\> $Context = New-AzStorageContext -StorageAccountName "ContosoGeneral" -SasToken $SasToken -PS C:\> $Context | Get-AzStorageBlob -Container "ContosoMain" +```powershell +$SasToken = New-AzStorageContainerSASToken -Name "ContosoMain" -Permission "rad" +$Context = New-AzStorageContext -StorageAccountName "ContosoGeneral" -SasToken $SasToken +$Context | Get-AzStorageBlob -Container "ContosoMain" ``` The first command generates an SAS token by using the **New-AzStorageContainerSASToken** cmdlet for the container named ContosoMain, and then stores that token in the $SasToken variable. @@ -180,39 +180,39 @@ The second command creates a context for the account named ContosoGeneral that u The final command lists all the blobs associated with the container named ContosoMain by using the context stored in $Context. ### Example 10: Create a context by using the OAuth Authentication -``` -PS C:\>Connect-AzAccount -PS C:\> $Context = New-AzStorageContext -StorageAccountName "myaccountname" -UseConnectedAccount +```powershell +Connect-AzAccount +$Context = New-AzStorageContext -StorageAccountName "myaccountname" -UseConnectedAccount ``` This command creates a context by using the OAuth (Azure AD) Authentication. ### Example 11: Create a context by specifying a storage account name, storage account key and custom blob endpoint -``` -PS C:\> New-AzStorageContext -StorageAccountName "myaccountname" -StorageAccountKey "< Storage Key for myaccountname ends with == >" -BlobEndpoint "https://myaccountname.blob.core.windows.net/" +```powershell +New-AzStorageContext -StorageAccountName "myaccountname" -StorageAccountKey "< Storage Key for myaccountname ends with == >" -BlobEndpoint "https://myaccountname.blob.core.windows.net/" ``` -This command creates a context for the account named myaccountname with a key for the account, and specified blob endpoint and table endpoint. +This command creates a context for the account named myaccountname with a key for the account, and specified blob endpoint. -### Example 12: Create a context for an anonymous storage accouont with specified file and queue endpoints -``` -PS C:\> New-AzStorageContext -StorageAccountName "myaccountname" -Anonymous -Protocol "http" -FileEndpoint "https://myaccountname.file.core.windows.net/" -QueueEndpoint "https://myaccountname.queue.core.windows.net/" +### Example 12: Create a context for an anonymous storage account with specified blob endpoint +```powershell +New-AzStorageContext -Anonymous -BlobEndpoint "https://myaccountname.blob.core.windows.net/" ``` -This command creates a context for anonymous use for the account named myaccountname, with specified file and queue endpoints. +This command creates a context for anonymous use for the account named myaccountname, with specified blob enpoint. ### Example 13: Create a context by using an SAS token with specified endpoints -``` -PS C:\>$SasToken = New-AzStorageContainerSASToken -Name "MyContainer" -Permission "rad" -PS C:\> New-AzStorageContext -StorageAccountName "myaccountname" -SasToken $SasToken -BlobEndpoint "https://myaccountname.blob.core.windows.net/" -TableEndpoint "https://myaccountname.table.core.windows.net/" -FileEndpoint "https://myaccountname.file.core.windows.net/" -QueueEndpoint "https://myaccountname.queue.core.windows.net/" +```powershell +$SasToken = New-AzStorageContainerSASToken -Name "MyContainer" -Permission "rad" +New-AzStorageContext -SasToken $SasToken -BlobEndpoint "https://myaccountname.blob.core.windows.net/" -TableEndpoint "https://myaccountname.table.core.windows.net/" -FileEndpoint "https://myaccountname.file.core.windows.net/" -QueueEndpoint "https://myaccountname.queue.core.windows.net/" ``` The first command generates an SAS token by using the New-AzStorageContainerSASToken cmdlet for the container named MyContainer, and then stores that token in the $SasToken variable. -The second command creates a context for the account named myaccountname that uses the SAS token and a specified blob endpoint, table endpoint, file endpoint, and queue endpoint. +The second command creates a context that uses the SAS token and a specified blob endpoint, table endpoint, file endpoint, and queue endpoint. -### Example 14: Create ea context by using the OAuth Authentication with a specified blob endpoint -``` -PS C:\> New-AzStorageContext -UseConnectedAccount -BlobEndpoint "https://myaccountname.blob.core.windows.net/" +### Example 14: Create a context by using the OAuth Authentication with a specified blob endpoint +```powershell +New-AzStorageContext -UseConnectedAccount -BlobEndpoint "https://myaccountname.blob.core.windows.net/" ``` This command creates a context by using the OAuth authentication with a specified blob endpoint. diff --git a/src/Storage/Storage.Management/help/New-AzStorageDirectory.md b/src/Storage/Storage.Management/help/New-AzStorageDirectory.md index df1b8d985fb8..466606e83d0c 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageDirectory.md +++ b/src/Storage/Storage.Management/help/New-AzStorageDirectory.md @@ -41,15 +41,15 @@ This cmdlet returns a **CloudFileDirectory** object. ## EXAMPLES ### Example 1: Create a folder in a file share -``` -PS C:\>New-AzStorageDirectory -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" +```powershell +New-AzStorageDirectory -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" ``` This command creates a folder named ContosoWorkingFolder in the file share named ContosoShare06. ### Example 2: Create a folder in a file share specified in a file share object -``` -PS C:\>Get-AzStorageShare -Name "ContosoShare06" | New-AzStorageDirectory -Path "ContosoWorkingFolder" +```powershell +Get-AzStorageShare -Name "ContosoShare06" | New-AzStorageDirectory -Path "ContosoWorkingFolder" ``` This command uses the **Get-AzStorageShare** cmdlet to get the file share named ContosoShare06, and then passes it to the current cmdlet by using the pipeline operator. diff --git a/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md index b3fdc534d230..30c9b567d405 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md @@ -46,10 +46,10 @@ The **New-AzStorageEncryptionScope** cmdlet creates an encryption scope for a St ## EXAMPLES ### Example 1: Create an encryption scope with Storage Encryption - +```powershell +New-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption ``` -PS C:\> New-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption - +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption @@ -60,12 +60,12 @@ testscope Enabled Microsoft.Storage This command creates an encryption scope with Storage Encryption. ### Example 2: Create an encryption scope with Keyvault Encryption, and RequireInfrastructureEncryption - -``` -PS C:\> New-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` +```powershell +New-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` -EncryptionScopeName testscope -KeyvaultEncryption -KeyUri "https://keyvalutname.vault.azure.net:443/keys/keyname/34a0ba563b4243d9a0ef2b1d3c0c7d57" ` -RequireInfrastructureEncryption - +``` +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption diff --git a/src/Storage/Storage.Management/help/New-AzStorageFileSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageFileSASToken.md index f1693392dc8c..de0cb0bcf7c3 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageFileSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageFileSASToken.md @@ -49,17 +49,17 @@ The **New-AzStorageFileSASToken** cmdlet generates a shared access signature tok ## EXAMPLES ### Example 1: Generate a shared access signature token that has full file permissions -``` -PS C:\> New-AzStorageFileSASToken -ShareName "ContosoShare" -Path "FilePath" -Permission "rwd" +```powershell +New-AzStorageFileSASToken -ShareName "ContosoShare" -Path "FilePath" -Permission "rwd" ``` This command generates a shared access signature token that has full permissions for the file that is named FilePath. ### Example 2: Generate a shared access signature token that has a time limit -``` -PS C:\> $StartTime = Get-Date -PS C:\> $EndTime = $StartTime.AddHours(2.0) -PS C:\> New-AzStorageFileSASToken -ShareName "ContosoShare" -Path "FilePath" -Permission "rwd" -StartTime $StartTime -ExpiryTime $EndTime +```powershell +$StartTime = Get-Date +$EndTime = $StartTime.AddHours(2.0) +New-AzStorageFileSASToken -ShareName "ContosoShare" -Path "FilePath" -Permission "rwd" -StartTime $StartTime -ExpiryTime $EndTime ``` The first command creates a **DateTime** object by using the Get-Date cmdlet. diff --git a/src/Storage/Storage.Management/help/New-AzStorageLocalUserSshPassword.md b/src/Storage/Storage.Management/help/New-AzStorageLocalUserSshPassword.md index 507587a0d14c..00a0288b3629 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageLocalUserSshPassword.md +++ b/src/Storage/Storage.Management/help/New-AzStorageLocalUserSshPassword.md @@ -37,7 +37,7 @@ The **New-AzStorageLocalUserSshPassword** cmdlet regenerates SSH password of a s ### Example 1: Regenerate SSH password of a specified local user ```powershell -PS C:\> New-AzStorageLocalUserSshPassword -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -UserName testuser1 +New-AzStorageLocalUserSshPassword -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -UserName testuser1 ``` ```output diff --git a/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md b/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md index 8934fc4a69b2..bd2135cf5e7b 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md +++ b/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md @@ -24,12 +24,13 @@ The **Get-AzStorageObjectReplicationPolicy** cmdlet creates an object replicatio ## EXAMPLES ### Example 1: Create an object replication policy rule with only source and destination account, and show its properties - -``` -PS C:\> $rule1 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src1 -DestinationContainer dest1 +```powershell +$rule1 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src1 -DestinationContainer dest1 -PS C:\> $rule1 +$rule1 +``` +```output RuleId SourceContainer DestinationContainer Filters.PrefixMatch Filters.MinCreationTime ------ --------------- -------------------- ------------------- ----------------------- src1 dest1 {} @@ -38,12 +39,13 @@ RuleId SourceContainer DestinationContainer Filters.PrefixMatch Filters.MinCreat This command creates an object replication policy rule with only source and destination account, and show its properties. ### Example 2: Create an object replication policy rule with all properties, and show its properties - -``` -PS C:\> $rule2 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src -DestinationContainer dest -MinCreationTime 2019-01-01T16:00:00Z -PrefixMatch a,abc,dd +```powershell +$rule2 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src -DestinationContainer dest -MinCreationTime 2019-01-01T16:00:00Z -PrefixMatch a,abc,dd -PS C:\> $rule2 +$rule2 +``` +```output RuleId SourceContainer DestinationContainer Filters.PrefixMatch Filters.MinCreationTime ------ --------------- -------------------- ------------------- ----------------------- src dest {a, abc, dd} 2019-01-01T16:00:00Z diff --git a/src/Storage/Storage.Management/help/New-AzStorageQueue.md b/src/Storage/Storage.Management/help/New-AzStorageQueue.md index dad13570a509..5384cfab1b47 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageQueue.md +++ b/src/Storage/Storage.Management/help/New-AzStorageQueue.md @@ -24,15 +24,15 @@ The **New-AzStorageQueue** cmdlet creates a storage queue in Azure. ## EXAMPLES ### Example 1: Create an Azure storage queue -``` -PS C:\>New-AzStorageQueue -Name "queueabc" +```powershell +New-AzStorageQueue -Name "queueabc" ``` This example creates a storage queue named queueabc. ### Example 2: Create multiple azure storage queues -``` -PS C:\>"queue1 queue2 queue3".split() | New-AzStorageQueue +```powershell +"queue1 queue2 queue3".split() | New-AzStorageQueue ``` This example creates multiple storage queues. diff --git a/src/Storage/Storage.Management/help/New-AzStorageQueueSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageQueueSASToken.md index 748e917a7b2e..e6dbdd8fa8e5 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageQueueSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageQueueSASToken.md @@ -33,8 +33,8 @@ The **New-AzStorageQueueSASToken** cmdlet generates shared access signature toke ## EXAMPLES ### Example 1: Generate a queue SAS token with full permission -``` -PS C:\>New-AzStorageQueueSASToken -Name "Test" -Permission raup +```powershell +New-AzStorageQueueSASToken -Name "Test" -Permission raup ``` This example generates a queue SAS token with full permission. diff --git a/src/Storage/Storage.Management/help/New-AzStorageQueueStoredAccessPolicy.md b/src/Storage/Storage.Management/help/New-AzStorageQueueStoredAccessPolicy.md index c8a063b27a4a..d2f9aa3a7e23 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageQueueStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/New-AzStorageQueueStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **New-AzStorageQueueStoredAccessPolicy** cmdlet creates a stored access poli ## EXAMPLES ### Example 1: Create a stored access policy in a storage queue -``` -PS C:\>New-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy01" +```powershell +New-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy01" ``` This command creates an access policy named Policy01 in the storage queue named MyQueue. diff --git a/src/Storage/Storage.Management/help/New-AzStorageShare.md b/src/Storage/Storage.Management/help/New-AzStorageShare.md index 7ee3c786e11a..a76d953ad8b8 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageShare.md +++ b/src/Storage/Storage.Management/help/New-AzStorageShare.md @@ -25,8 +25,8 @@ The **New-AzStorageShare** cmdlet creates a file share. ## EXAMPLES ### Example 1: Create a file share -``` -PS C:\>New-AzStorageShare -Name "ContosoShare06" +```powershell +New-AzStorageShare -Name "ContosoShare06" ``` This command creates a file share named ContosoShare06. diff --git a/src/Storage/Storage.Management/help/New-AzStorageShareSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageShareSASToken.md index 2c5f1e99f79d..5d99353bd35a 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageShareSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageShareSASToken.md @@ -33,15 +33,15 @@ The **New-AzStorageShareSASToken** cmdlet generates a shared access signature to ## EXAMPLES ### Example 1: Generate a shared access signature token for a share -``` -PS C:\>New-AzStorageShareSASToken -ShareName "ContosoShare" -Permission "rwdl" +```powershell +New-AzStorageShareSASToken -ShareName "ContosoShare" -Permission "rwdl" ``` This command creates a shared access signature token for the share named ContosoShare. ### Example 2: Generate multiple shared access signature token by using the pipeline -``` -PS C:\>Get-AzStorageShare -Prefix "test" | New-AzStorageShareSASToken -Permission "rwdl" +```powershell +Get-AzStorageShare -Prefix "test" | New-AzStorageShareSASToken -Permission "rwdl" ``` This command gets all the Storage shares that match the prefix test. @@ -49,8 +49,8 @@ The command passes them to the current cmdlet by using the pipeline operator. The current cmdlet creates a shared access token for each Storage share that has the specified permissions. ### Example 3: Generate a shared access signature token that uses a shared access policy -``` -PS C:\>New-AzStorageShareSASToken -ShareName "ContosoShare" -Policy "ContosoPolicy03" +```powershell +New-AzStorageShareSASToken -ShareName "ContosoShare" -Policy "ContosoPolicy03" ``` This command creates a shared access signature token for the Storage share named ContosoShare that has the policy named ContosoPolicy03. diff --git a/src/Storage/Storage.Management/help/New-AzStorageShareStoredAccessPolicy.md b/src/Storage/Storage.Management/help/New-AzStorageShareStoredAccessPolicy.md index b9c46609bd53..8249a96c05c6 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageShareStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/New-AzStorageShareStoredAccessPolicy.md @@ -26,8 +26,8 @@ The **New-AzStorageShareStoredAccessPolicy** cmdlet creates a stored access poli ## EXAMPLES ### Example 1: Create a stored access policy in a share -``` -PS C:\>New-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" -Permission "rwdl" +```powershell +New-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" -Permission "rwdl" ``` This command creates a stored access policy that has full permission in a share. diff --git a/src/Storage/Storage.Management/help/New-AzStorageTable.md b/src/Storage/Storage.Management/help/New-AzStorageTable.md index d7bc7fc6bcb5..3fcebcb2c709 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageTable.md +++ b/src/Storage/Storage.Management/help/New-AzStorageTable.md @@ -24,13 +24,14 @@ The **New-AzStorageTable** cmdlet creates a storage table associated with the st ## EXAMPLES ### Example 1: Create an azure storage table -``` -PS C:\>New-AzStorageTable -Name "tableabc" +```powershell +New-AzStorageTable -Name "tableabc" ``` This command creates a storage table with a name of tableabc. ### Example 2: Create multiple azure storage tables + ``` PS C:\>"table1 table2 table3".split() | New-AzStorageTable ``` diff --git a/src/Storage/Storage.Management/help/New-AzStorageTableSASToken.md b/src/Storage/Storage.Management/help/New-AzStorageTableSASToken.md index 38cccef10a23..3adf2b6c9f61 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageTableSASToken.md +++ b/src/Storage/Storage.Management/help/New-AzStorageTableSASToken.md @@ -35,24 +35,24 @@ The **New-AzStorageTableSASToken** cmdlet generates a Shared Access Signature (S ## EXAMPLES ### Example 1: Generate an SAS token that has full permissions for a table -``` -C:\PS>New-AzStorageTableSASToken -Name "ContosoResources" -Permission "raud" +```powershell +New-AzStorageTableSASToken -Name "ContosoResources" -Permission "raud" ``` This command generates an SAS token with full permissions for the table named ContosoResources. That token is for read, add, update, and delete permissions. ### Example 2: Generate an SAS token for a range of partitions -``` -C:\PS>New-AzStorageTableSASToken -Name "ContosoResources" -Permission "raud" -StartPartitionKey "a" -EndPartitionKey "b" +```powershell +New-AzStorageTableSASToken -Name "ContosoResources" -Permission "raud" -StartPartitionKey "a" -EndPartitionKey "b" ``` This command generates and SAS token with full permissions for the table named ContosoResources. The command limits the token to the range that the *StartPartitionKey* and *EndPartitionKey* parameters specify. ### Example 3: Generate an SAS token that has a stored access policy for a table -``` -C:\PS>New-AzStorageTableSASToken -Name "ContosoResources" -Policy "ClientPolicy01" +```powershell +New-AzStorageTableSASToken -Name "ContosoResources" -Policy "ClientPolicy01" ``` This command generates an SAS token for the table named ContosoResources. diff --git a/src/Storage/Storage.Management/help/New-AzStorageTableStoredAccessPolicy.md b/src/Storage/Storage.Management/help/New-AzStorageTableStoredAccessPolicy.md index 0aa4ea72e7c4..946821d9defc 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageTableStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/New-AzStorageTableStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **New-AzStorageTableStoredAccessPolicy** cmdlet creates a stored access poli ## EXAMPLES ### Example 1: Create a stored access policy in a table -``` -PS C:\>New-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy02" +```powershell +New-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy02" ``` This command creates an access policy named Policy02 in the storage table named MyTable. diff --git a/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2Item.md index 111daee83068..763ec6e5bbd9 100644 --- a/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2Item.md @@ -33,22 +33,22 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Removes a directory -``` -PS C:\>Remove-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" +```powershell +Remove-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" ``` This command removes a directory from a Filesystem. ### Example 2: Removes a file without prompt -``` -PS C:\>Remove-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" -Force +```powershell +Remove-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" -Force ``` This command removes a directory from a Filesystem, without prompt. ### Example 3: Remove all items in a Filesystem with pipeline -``` -PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" | Remove-AzDataLakeGen2Item -Force +```powershell +Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" | Remove-AzDataLakeGen2Item -Force ``` This command removes all items in a Filesystem with pipeline. diff --git a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainer.md index 1b24079da616..c416c9b025d1 100644 --- a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainer.md @@ -36,23 +36,23 @@ The **Remove-AzRmStorageContainer** cmdlet removes a Storage blob container ## EXAMPLES ### Example 1: Remove a Storage blob container with Storage account name and container name -``` -PS C:\>Remove-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" +```powershell +Remove-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" ``` This command removes a Storage blob container with Storage account name and container name. ### Example 2: Remove a Storage blob container with Storage account object and container name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Remove-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Remove-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" ``` This command removes a Storage blob container with Storage account object and container name. ### Example 3: Remove all Storage blob containers in a Storage account with pipeline -``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Remove-AzRmStorageContainer -Force +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Remove-AzRmStorageContainer -Force ``` This command removes all Storage blob containers in a Storage account with pipeline. diff --git a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerImmutabilityPolicy.md index 096ec0c9ce6a..f2855fc7a8ab 100644 --- a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerImmutabilityPolicy.md @@ -43,34 +43,34 @@ The **Remove-AzRmStorageContainerImmutabilityPolicy** cmdlet removes Immutabilit ## EXAMPLES ### Example 1: Remove unlocked ImmutabilityPolicy of a Storage blob container with Storage account name and container name -``` -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -PS C:\>Remove-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Etag $policy.Etag +```powershell +$policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" +Remove-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Etag $policy.Etag ``` This command removes unlocked ImmutabilityPolicy of a Storage blob container with Storage account name and container name. ### Example 2: Remove unlocked ImmutabilityPolicy of a Storage blob container, with Storage account object -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -PS C:\>Remove-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -Etag $policy.Etag +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" +Remove-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -Etag $policy.Etag ``` This command removes unlocked ImmutabilityPolicy of a Storage blob container, with Storage account object. ### Example 3: Remove unlocked ImmutabilityPolicy of a Storage blob container, with container object -``` -PS C:\>$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -PS C:\>Remove-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -Etag $policy.Etag +```powershell +$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" +$policy = Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject +Remove-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -Etag $policy.Etag ``` This command removes unlocked ImmutabilityPolicy of a Storage blob container with Storage container object. ### Example 4: Remove unlocked ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object -``` -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Remove-AzRmStorageContainerImmutabilityPolicy +```powershell +Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Remove-AzRmStorageContainerImmutabilityPolicy ``` This command removes unlocked ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object. diff --git a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerLegalHold.md b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerLegalHold.md index 854c45e3faf4..78bcc0b4c18e 100644 --- a/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerLegalHold.md +++ b/src/Storage/Storage.Management/help/Remove-AzRmStorageContainerLegalHold.md @@ -37,23 +37,23 @@ The **Remove-AzRmStorageContainerLegalHold** cmdlet removes legal hold tags from ## EXAMPLES ### Example 1: Remove legal hold tags from a Storage blob container with Storage account name and container name -``` -PS C:\>Remove-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag tag1 +```powershell +Remove-AzRmStorageContainerLegalHold -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -Tag tag1 ``` This command removes legal hold tags from a Storage blob container with Storage account name and container name. ### Example 2: Remove legal hold tags from a Storage blob container with Storage account object and container name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Remove-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer" -Tag tag1,tag2 +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Remove-AzRmStorageContainerLegalHold -StorageAccount $accountObject -ContainerName "myContainer" -Tag tag1,tag2 ``` This command removes legal hold tags from a Storage blob container with Storage account object and container name. ### Example 3: Remove legal hold tags from all Storage blob containers in a Storage account with pipeline -``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Remove-AzRmStorageContainerLegalHold -Tag tag1 +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Remove-AzRmStorageContainerLegalHold -Tag tag1 ``` This command removes legal hold tags from all Storage blob containers in a Storage account with pipeline. diff --git a/src/Storage/Storage.Management/help/Remove-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Remove-AzRmStorageShare.md index 1428453bc750..eb84e9a4c452 100644 --- a/src/Storage/Storage.Management/help/Remove-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Remove-AzRmStorageShare.md @@ -56,45 +56,45 @@ The **New-AzRmStorageShare** cmdlet removes a Storage file share. ## EXAMPLES ### Example 1: Remove a Storage file share with Storage account name and share name -``` -PS C:\>Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" +```powershell +Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" ``` This command removes a Storage file share with Storage account name and share name. ### Example 2: Remove a Storage file share with Storage account object and share name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -PS C:\>Remove-AzRmStorageShare -StorageAccount $accountObject -Name "myshare" +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" +Remove-AzRmStorageShare -StorageAccount $accountObject -Name "myshare" ``` This command removes a Storage file share with Storage account object and share name. ### Example 3: Remove all Storage file shares in a Storage account with pipeline -``` -PS C:\>Get-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" | Remove-AzRmStorageShare -Force +```powershell +Get-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" | Remove-AzRmStorageShare -Force ``` This command removes all Storage file shares in a Storage account with pipeline. ### Example 4: Remove a single Storage file share snapshot -``` -PS C:\>Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -SnapshotTime "2021-05-10T08:04:08Z" +```powershell +Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -SnapshotTime "2021-05-10T08:04:08Z" ``` This command removes a single Storage file share snapshot with the specific share name and snapshot time ### Example 5: Remove a Storage file share and it's snapshots -``` -PS C:\>Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -Include Snapshots +```powershell +Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -Include Snapshots ``` This command removes a Storage file share and it's snapshots By default, the cmdlet will fail if the file share has snapshots without "-include" parameter. ### Example 6: Remove a Storage file share and all it's snapshots (include leased snapshots) -``` -PS C:\>Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -Include Leased-Snapshots +```powershell +Remove-AzRmStorageShare -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -Name "myshare" -Include Leased-Snapshots ``` This command removes a Storage file share and all it's snapshots, include leased and not leased snapshots. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageAccount.md b/src/Storage/Storage.Management/help/Remove-AzStorageAccount.md index 56a746d6a998..2d161f17a343 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageAccount.md @@ -24,8 +24,8 @@ The **Remove-AzStorageAccount** cmdlet removes a Storage account from Azure. ## EXAMPLES ### Example 1: Remove a Storage account -``` -PS C:\>Remove-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +```powershell +Remove-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" ``` This command removes the specified Storage account. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageAccountManagementPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageAccountManagementPolicy.md index 625801338fa3..a36ea1dc5988 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageAccountManagementPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageAccountManagementPolicy.md @@ -42,8 +42,8 @@ The **Remove-AzStorageAccountManagementPolicy** cmdlet removes the management po ## EXAMPLES ### Example 1: Remove the management policy of a Storage account. -``` -PS C:\>Remove-AzStorageAccountManagementPolicy -ResourceGroupName "MyResourceGroup" -AccountName "mystorageaccount" +```powershell +Remove-AzStorageAccountManagementPolicy -ResourceGroupName "MyResourceGroup" -AccountName "mystorageaccount" ``` This command removes the management policy of a Storage account. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageAccountNetworkRule.md b/src/Storage/Storage.Management/help/Remove-AzStorageAccountNetworkRule.md index 1e5ee1a66c9e..db9263f1c4ed 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageAccountNetworkRule.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageAccountNetworkRule.md @@ -58,43 +58,43 @@ The **Remove-AzStorageAccountNetworkRule** cmdlet removes IpRules or VirtualNetw ## EXAMPLES ### Example 1: Remove several IpRules with IPAddressOrRange -``` -PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPAddressOrRange "10.0.0.0/7,28.1.0.0/16" +```powershell +Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IPAddressOrRange "10.0.0.0/7,28.1.0.0/16" ``` This command remove several IpRules with IPAddressOrRange. ### Example 2: Remove a VirtualNetworkRule with VirtualNetworkRule Object input with JSON -``` -PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkRules (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"}) +```powershell +Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkRule (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"}) ``` This command remove a VirtualNetworkRule with VirtualNetworkRule Object input with JSON. ### Example 3: Remove first IpRule with pipeline -``` -PS C:\>(Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").IpRules[0] | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "myStorageAccount" +```powershell +(Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").IpRules[0] | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "myStorageAccount" ``` This command remove first IpRule with pipeline. ### Example 4: Remove several VirtualNetworkRules with VirtualNetworkResourceID -``` -PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkResourceId "/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1","/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2" +```powershell +Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkResourceId "/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1","/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2" ``` This command remove several VirtualNetworkRules with VirtualNetworkResourceID. ### Example 5: Remove a resource access rule with TenantId and ResourceId. -``` -PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -TenantId $tenantId -ResourceId $ResourceId +```powershell +Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -TenantId $tenantId -ResourceId $ResourceId ``` This command removes a resource access rule with TenantId and ResourceId. ### Example 6: Remove the first 3 resource access rules from a storage account -``` -PS C:\> (Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").ResourceAccessRules | Select-Object -First 3 | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" +```powershell +(Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").ResourceAccessRules | Select-Object -First 3 | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" ``` This command removes the first 3 resource access rules from a storage account. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageBlob.md b/src/Storage/Storage.Management/help/Remove-AzStorageBlob.md index 036eefc94ece..d3c25566461c 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageBlob.md @@ -45,36 +45,36 @@ The **Remove-AzStorageBlob** cmdlet removes the specified blob from a storage ac ## EXAMPLES ### Example 1: Remove a storage blob by name -``` -PS C:\>Remove-AzStorageBlob -Container "ContainerName" -Blob "BlobName" +```powershell +Remove-AzStorageBlob -Container "ContainerName" -Blob "BlobName" ``` This command removes a blob identified by its name. ### Example 2: Remove a storage blob using the pipeline -``` -PS C:\>Get-AzStorageBlob -Container "ContainerName" -Blob "BlobName" | Remove-AzStorageBlob +```powershell +Get-AzStorageBlob -Container "ContainerName" -Blob "BlobName" | Remove-AzStorageBlob ``` This command uses the pipeline. ### Example 3: Remove storage blobs using the pipeline -``` -PS C:\>Get-AzStorageContainer -Container container* | Remove-AzStorageBlob -Blob "BlobName" +```powershell +Get-AzStorageContainer -Container container* | Remove-AzStorageBlob -Blob "BlobName" ``` This command uses the asterisk (*) wildcard character and the pipeline to retrieve the blob or blobs and then removes them. ### Example 4: Remove a single blob version -``` -PS C:\> Remove-AzStorageBlob -Container "containername" -Blob blob2 -VersionId "2020-07-03T16:19:16.2883167Z" +```powershell +Remove-AzStorageBlob -Container "containername" -Blob blob2 -VersionId "2020-07-03T16:19:16.2883167Z" ``` This command removes a single blobs verion with VersionId. ### Example 5: Remove a single blob snapshot -``` -PS C:\> Remove-AzStorageBlob -Container "containername" -Blob blob1 -SnapshotTime "2020-07-06T06:56:06.8588431Z" +```powershell +Remove-AzStorageBlob -Container "containername" -Blob blob1 -SnapshotTime "2020-07-06T06:56:06.8588431Z" ``` This command removes a single blobs snapshot with SnapshotTime. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageBlobInventoryPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageBlobInventoryPolicy.md index 8d0e120af279..879b3de3037e 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageBlobInventoryPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageBlobInventoryPolicy.md @@ -42,8 +42,8 @@ The **Remove-AzStorageBlobInventoryPolicy** cmdlet removes blob inventory policy ## EXAMPLES ### Example 1: Remove blob inventory policy from a Storage account -``` -PS C:\>Remove-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" +```powershell +Remove-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ``` This command removes blob inventory policy from a Storage account. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageCORSRule.md b/src/Storage/Storage.Management/help/Remove-AzStorageCORSRule.md index 9288fd374df2..7a60208565e0 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageCORSRule.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageCORSRule.md @@ -27,8 +27,8 @@ The types of storage services for this cmdlet are Blob, Table, Queue, and File. ## EXAMPLES ### Example 1: Remove CORS rules for the blob service -``` -PS C:\>Remove-AzStorageCORSRule -ServiceType Blob +```powershell +Remove-AzStorageCORSRule -ServiceType Blob ``` This command removes CORS rules for the Blob service type. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageContainer.md b/src/Storage/Storage.Management/help/Remove-AzStorageContainer.md index cffe77a50210..922498261a8e 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageContainer.md @@ -26,8 +26,8 @@ The **Remove-AzStorageContainer** cmdlet removes the specified storage container ## EXAMPLES ### Example 1: Remove a container -``` -PS C:\>Remove-AzStorageContainer -Name "MyTestContainer" +```powershell +Remove-AzStorageContainer -Name "MyTestContainer" ``` This example removes a container named MyTestContainer. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageContainerStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageContainerStoredAccessPolicy.md index c7d331c13088..1fcb1049eaa0 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageContainerStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageContainerStoredAccessPolicy.md @@ -26,8 +26,8 @@ The **Remove-AzStorageContainerStoredAccessPolicy** cmdlet removes a stored acce ## EXAMPLES ### Example 1: Remove a stored access policy from a storage container -``` -PS C:\>Remove-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy03" +```powershell +Remove-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy03" ``` This command removes an access policy named Policy03 from the stored container named MyContainer. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageDirectory.md b/src/Storage/Storage.Management/help/Remove-AzStorageDirectory.md index 1af6c589dc3c..b0a514e608ff 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageDirectory.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageDirectory.md @@ -43,8 +43,8 @@ The **Remove-AzStorageDirectory** cmdlet deletes a directory. ## EXAMPLES ### Example 1: Delete a folder -``` -PS C:\>Remove-AzStorageDirectory -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" +```powershell +Remove-AzStorageDirectory -ShareName "ContosoShare06" -Path "ContosoWorkingFolder" ``` This command deletes the folder named ContosoWorkingFolder from the file share named ContosoShare06. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageFile.md b/src/Storage/Storage.Management/help/Remove-AzStorageFile.md index a6811be779e6..6cd8fb391118 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageFile.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageFile.md @@ -49,15 +49,15 @@ The **Remove-AzStorageFile** cmdlet deletes a file. ## EXAMPLES ### Example 1: Delete a file from a file share -``` -PS C:\>Remove-AzStorageFile -ShareName "ContosoShare06" -Path "ContosoFile22" +```powershell +Remove-AzStorageFile -ShareName "ContosoShare06" -Path "ContosoFile22" ``` This command deletes the file that is named ContosoFile22 from the file share named ContosoShare06. ### Example 2: Get a file from a file share by using a file share object -``` -PS C:\>Get-AzStorageShare -Name "ContosoShare06" | Remove-AzStorageFile -Path "ContosoFile22" +```powershell +Get-AzStorageShare -Name "ContosoShare06" | Remove-AzStorageFile -Path "ContosoFile22" ``` This command uses the **Get-AzStorageShare** cmdlet to get the file share named ContosoShare06, and then passes that object to the current cmdlet by using the pipeline operator. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageObjectReplicationPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageObjectReplicationPolicy.md index b44fdbbdf5a9..8698e2dde3d6 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageObjectReplicationPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageObjectReplicationPolicy.md @@ -37,7 +37,7 @@ The **Remove-AzStorageObjectReplicationPolicy** cmdlet removes the specified obj ## EXAMPLES ### Example 1: Remove an object replication policy with specific policyId from a storage account. -``` +```powershell Remove-AzStorageObjectReplicationPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PolicyId $policyId ``` diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageQueue.md b/src/Storage/Storage.Management/help/Remove-AzStorageQueue.md index 44e31b46f1e1..5534859d44b5 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageQueue.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageQueue.md @@ -24,15 +24,15 @@ The **Remove-AzStorageQueue** cmdlet removes a storage queue. ## EXAMPLES ### Example 1: Remove a storage queue by name -``` -PS C:\>Remove-AzStorageQueue "ContosoQueue01" +```powershell +Remove-AzStorageQueue "ContosoQueue01" ``` This command removes a queue named ContosoQueue01. ### Example 2: Remove multiple storage queues -``` -PS C:\>Get-AzStorageQueue "Contoso*" | Remove-AzStorageQueue +```powershell +Get-AzStorageQueue "Contoso*" | Remove-AzStorageQueue ``` This command removes all queues with names that start with Contoso. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageQueueStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageQueueStoredAccessPolicy.md index 346d48e5a347..a3b17b1fde08 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageQueueStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageQueueStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **Remove-AzStorageQueueStoredAccessPolicy** cmdlet removes a stored access p ## EXAMPLES ### Example 1: Remove a stored access policy from a storage queue -``` -PS C:\>Remove-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy04" +```powershell +Remove-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy04" ``` This command removes an access policy named Policy04 from the storage queue named MyQueue. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageShare.md b/src/Storage/Storage.Management/help/Remove-AzStorageShare.md index 69fb0a669341..7bec4e81ffba 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageShare.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageShare.md @@ -35,15 +35,15 @@ The **Remove-AzStorageShare** cmdlet deletes a file share. ## EXAMPLES ### Example 1: Remove a file share -``` -PS C:\>Remove-AzStorageShare -Name "ContosoShare06" +```powershell +Remove-AzStorageShare -Name "ContosoShare06" ``` This command removes the file share named ContosoShare06. ### Example 2: Remove a file share and all its snapshots -``` -PS C:\>Remove-AzStorageShare -Name "ContosoShare06" -IncludeAllSnapshot +```powershell +Remove-AzStorageShare -Name "ContosoShare06" -IncludeAllSnapshot ``` This command removes the file share named ContosoShare06 and all its snapshots. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageShareStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageShareStoredAccessPolicy.md index 576430d76b41..5929f3d1cb5f 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageShareStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageShareStoredAccessPolicy.md @@ -26,8 +26,8 @@ The **Remove-AzStorageShareStoredAccessPolicy** cmdlet removes a stored access p ## EXAMPLES ### Example 1: Remove a stored access policy from an Azure Storage share -``` -PS C:\>Remove-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" +```powershell +Remove-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" ``` This command removes a stored access policy named GeneralPolicy from ContosoShare. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageTable.md b/src/Storage/Storage.Management/help/Remove-AzStorageTable.md index 7a71d92d62d3..714ad7ef6ae7 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageTable.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageTable.md @@ -24,15 +24,15 @@ The **Remove-AzStorageTable** cmdlet removes one or more storage tables from a s ## EXAMPLES ### Example 1: Remove a table -``` -PS C:\>Remove-AzStorageTable -Name "TableABC" +```powershell +Remove-AzStorageTable -Name "TableABC" ``` This command removes a table. ### Example 2: Remove several tables -``` -PS C:\>Get-AzStorageTable table* | Remove-AzStorageTable +```powershell +Get-AzStorageTable table* | Remove-AzStorageTable ``` This example uses a wildcard character with the *Name* parameter to get all tables that match the pattern table and then passes the result on the pipeline to remove the tables. diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageTableStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageTableStoredAccessPolicy.md index 67d91a2a7124..d549fccdc9f5 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageTableStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageTableStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **Remove-AzStorageTableStoredAccessPolicy** cmdlet removes a stored access p ## EXAMPLES ### Example 1: Remove a stored access policy from a storage table -``` -PS C:\>Remove-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy05" +```powershell +Remove-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy05" ``` This command removes policy named Policy05 from storage table named MyTable. diff --git a/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md b/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md index 6874a11f3ef7..cd17ac6d8222 100644 --- a/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md +++ b/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md @@ -60,14 +60,15 @@ Complete 6ca55a8b-fca0-461a-8e4c-13927a9707e6 2020-02-10T13:58:44. This command first creates 2 blob ranges, then start restores blobs in a Storage account with the 2 blob ranges from 1 day ago. User can use Get-AzStorageAccount to trace the restore status later. ### Example 2: Restores all blobs in a Storage account in the backend - ```powershell -PS C:\> $job = Restore-AzStorageBlobRange -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -TimeToRestore (Get-Date).AddMinutes(-30) -WaitForComplete -asjob +$job = Restore-AzStorageBlobRange -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -TimeToRestore (Get-Date).AddMinutes(-30) -WaitForComplete -asjob -PS C:\> $job | Wait-Job +$job | Wait-Job -PS C:\> $job.Output +$job.Output +``` +```output Status RestoreId FailureReason Parameters.TimeToRestore Parameters.BlobRanges ------ --------- ------------- ------------------------ --------------------- Complete 0387953a-bbe6-4602-818d-e661581ee44b 2020-08-28T07:11:33.9843100Z ["" -> ""] @@ -76,11 +77,13 @@ Complete 0387953a-bbe6-4602-818d-e661581ee44b 2020-08-28T07:11:33. This command restores all blobs in a Storage account from 30 minutes ago, and wait for the restore complete. Since restore blobs might take a long time, run it in the backend with -Asjob parameter, and then wait for the job complete and show the result. ### Example 3: Restores blobs by input blob ranges directly, and wait for complete - ```powershell -PS C:\> Restore-AzStorageBlobRange -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -WaitForComplete ` +Restore-AzStorageBlobRange -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -WaitForComplete ` -TimeToRestore (Get-Date).AddSeconds(-1) ` -BlobRestoreRange @{StartRange="aaa/abc";EndRange="bbb/abc"},@{StartRange="bbb/acc";EndRange=""} +``` + +```output WARNING: Restore blob rang with Id 'd66d1d02-6e48-47ef-b516-0155dd8319c6' started. Restore blob ranges time to complete is dependent on the size of the restore. Status RestoreId FailureReason Parameters.TimeToRestore Parameters.BlobRanges diff --git a/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md b/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md index 741f5b0a6421..f9e478be077b 100644 --- a/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md @@ -24,10 +24,11 @@ This cmdlet only works after enabled Container softdelete with Enable-AzStorageB ## EXAMPLES ### Example 1: List containers include deleted containers, and restore all deleted containers with pipeline - +```powershell +Get-AzStorageContainer -IncludeDeleted -Context $ctx | Where-Object { $_.IsDeleted } | Restore-AzStorageContainer ``` -PS C:\> Get-AzStorageContainer -IncludeDeleted -Context $ctx | Where-Object { $_.IsDeleted } | Restore-AzStorageContainer +```output Storage Account Name: storageaccountname Name PublicAccess LastModified IsDeleted VersionId diff --git a/src/Storage/Storage.Management/help/Revoke-AzStorageAccountUserDelegationKeys.md b/src/Storage/Storage.Management/help/Revoke-AzStorageAccountUserDelegationKeys.md index 124a70361516..3eaad9c54b33 100644 --- a/src/Storage/Storage.Management/help/Revoke-AzStorageAccountUserDelegationKeys.md +++ b/src/Storage/Storage.Management/help/Revoke-AzStorageAccountUserDelegationKeys.md @@ -37,7 +37,7 @@ The **Revoke-AzStorageAccountUserDelegationKeys** cmdlet revokes all User Delega ### Example 1: Revoke all User Delegation keys of a Storage account ```powershell -PS C:\>Revoke-AzStorageAccountUserDelegationKeys -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" +Revoke-AzStorageAccountUserDelegationKeys -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ``` This example revokes all User Delegation keys of a Storage account, so all Identity SAS token generated from the User Delegation keys will also be revoked. diff --git a/src/Storage/Storage.Management/help/Set-AzCurrentStorageAccount.md b/src/Storage/Storage.Management/help/Set-AzCurrentStorageAccount.md index 28912dbf0e38..36babc5c28cd 100644 --- a/src/Storage/Storage.Management/help/Set-AzCurrentStorageAccount.md +++ b/src/Storage/Storage.Management/help/Set-AzCurrentStorageAccount.md @@ -32,8 +32,8 @@ The current Storage account is used as the default when you access Storage witho ## EXAMPLES ### Example 1: Set the current Storage account -``` -PS C:\>Set-AzCurrentStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +```powershell +Set-AzCurrentStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" ``` This command sets the default Storage account for the specified subscription. diff --git a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md index 6b4ebdee8e40..6b572c9410bf 100644 --- a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md +++ b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md @@ -26,13 +26,14 @@ The input ACL will replace original ACL completely. ## EXAMPLES ### Example 1: Set ACL recursively on a directory - +```powershell +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl +Set-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -Context $ctx ``` -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl -PS C:\> Set-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -Context $ctx +```output FailedEntries : TotalDirectoriesSuccessfulCount : 7 TotalFilesSuccessfulCount : 5 @@ -78,7 +79,7 @@ This command first sets ACL recursively to a root directory and failed, then res ### Example 3: Set ACL recursively chunk by chunk -``` +```powershell $token = $null $TotalDirectoriesSuccess = 0 $TotalFilesSuccess = 0 diff --git a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md index c507ad453e6d..8e8aab9f06d2 100644 --- a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md +++ b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md @@ -24,13 +24,14 @@ If the new ACL entry with same AccessControlType/EntityId/DefaultScope not exist ## EXAMPLES ### Example 1: Create an ACL object with 3 ACL entry, and update ACL on a directory - +```powershell +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl +Update-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/dir3" -ACL $acl ``` -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl -PS C:\>Update-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/dir3" -ACL $acl +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/Set-AzRmStorageContainerImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Set-AzRmStorageContainerImmutabilityPolicy.md index 14412acdea5a..ea5221e24a6e 100644 --- a/src/Storage/Storage.Management/help/Set-AzRmStorageContainerImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzRmStorageContainerImmutabilityPolicy.md @@ -73,36 +73,36 @@ The **Set-AzRmStorageContainerImmutabilityPolicy** cmdlet creates or updates Imm ## EXAMPLES ### Example 1: Create or update ImmutabilityPolicy of a Storage blob container with Storage account name and container name -``` -PS C:\>Set-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -ImmutabilityPeriod 10 +```powershell +Set-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -ImmutabilityPeriod 10 ``` This command creates or updates ImmutabilityPolicy of a Storage blob container with Storage account name and container name. ### Example 2: Extend ImmutabilityPolicy of a Storage blob container, with Storage account object -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -PS C:\>Set-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -ImmutabilityPeriod 20 -Etag $policy.Etag -ExtendPolicy +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +$policy = Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" +Set-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer" -ImmutabilityPeriod 20 -Etag $policy.Etag -ExtendPolicy ``` This command extend ImmutabilityPolicy of a Storage blob container, with Storage account object. Extend ImmutabilityPolicy can only run after ImmutabilityPolicy is locked. ### Example 3: Update ImmutabilityPolicy of a Storage blob container -``` -PS C:\>$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" -PS C:\>$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -ImmutabilityPeriod 12 -PS C:\>$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -ImmutabilityPeriod 9 -Etag $policy.Etag -PS C:\>$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -AllowProtectedAppendWrite $true -PS C:\>$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -AllowProtectedAppendWrite $false -AllowProtectedAppendWriteAll $true +```powershell +$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer" +$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -ImmutabilityPeriod 12 +$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -ImmutabilityPeriod 9 -Etag $policy.Etag +$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -AllowProtectedAppendWrite $true +$policy = Set-AzRmStorageContainerImmutabilityPolicy -Container $containerObject -AllowProtectedAppendWrite $false -AllowProtectedAppendWriteAll $true ``` This command updates ImmutabilityPolicy of a Storage blob container with Storage container object 3 times: First to ImmutabilityPeriod 12 days without etag, then to ImmutabilityPeriod 9 days with etag, then enabled AllowProtectedAppendWrite, finally enabled AllowProtectedAppendWriteAll. ### Example 4: Extend ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object -``` -PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Set-AzRmStorageContainerImmutabilityPolicy -ImmutabilityPeriod 15 -ExtendPolicy +```powershell +Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" | Set-AzRmStorageContainerImmutabilityPolicy -ImmutabilityPeriod 15 -ExtendPolicy ``` This command extend ImmutabilityPolicy of a Storage blob container, with ImmutabilityPolicy object. Extend ImmutabilityPolicy can only run after ImmutabilityPolicy is locked. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageAccount.md b/src/Storage/Storage.Management/help/Set-AzStorageAccount.md index 86859fe7daa9..41c3bb32e15c 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageAccount.md @@ -92,90 +92,62 @@ You can use this cmdlet to modify the account type, update a customer domain, or ## EXAMPLES ### Example 1: Set the Storage account type - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName "Standard_RAGRS" +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName "Standard_RAGRS" ``` This command sets the Storage account type to Standard_RAGRS. ### Example 2: Set a custom domain for a Storage account - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.contoso.com" -UseSubDomain $true +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.contoso.com" -UseSubDomain $true ``` This command sets a custom domain for a Storage account. ### Example 3: Set the access tier value - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AccessTier Cool +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AccessTier Cool ``` The command sets the Access Tier value to be cool. ### Example 4: Set the custom domain and tags - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.domainname.com" -UseSubDomain $true -Tag @{tag0="value0";tag1="value1";tag2="value2"} +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.domainname.com" -UseSubDomain $true -Tag @{tag0="value0";tag1="value1";tag2="value2"} ``` The command sets the custom domain and tags for a Storage account. ### Example 5: Set Encryption KeySource to Keyvault - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AssignIdentity -PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AssignIdentity +$account = Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -PS C:\> $keyVault = New-AzKeyVault -VaultName "MyKeyVault" -ResourceGroupName "MyResourceGroup" -Location "EastUS2" -PS C:\> $key = Add-AzKeyVaultKey -VaultName "MyKeyVault" -Name "MyKey" -Destination 'Software' -PS C:\> Set-AzKeyVaultAccessPolicy -VaultName "MyKeyVault" -ObjectId $account.Identity.PrincipalId -PermissionsToKeys wrapkey,unwrapkey,get +$keyVault = New-AzKeyVault -VaultName "MyKeyVault" -ResourceGroupName "MyResourceGroup" -Location "EastUS2" +$key = Add-AzKeyVaultKey -VaultName "MyKeyVault" -Name "MyKey" -Destination 'Software' +Set-AzKeyVaultAccessPolicy -VaultName "MyKeyVault" -ObjectId $account.Identity.PrincipalId -PermissionsToKeys wrapkey,unwrapkey,get # In case to enable key auto rotation, don't set KeyVersion -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyvaultEncryption -KeyName $key.Name -KeyVersion $key.Version -KeyVaultUri $keyVault.VaultUri +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyvaultEncryption -KeyName $key.Name -KeyVersion $key.Version -KeyVaultUri $keyVault.VaultUri # In case to enable key auto rotation after set keyvault proeprites with KeyVersion, can update account by set KeyVersion to empty -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyvaultEncryption -KeyName $key.Name -KeyVersion "" -KeyVaultUri $keyVault.VaultUri +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -KeyvaultEncryption -KeyName $key.Name -KeyVersion "" -KeyVaultUri $keyVault.VaultUri ``` This command set Encryption KeySource with a new created Keyvault. If want to enable key auto rotation, don't set keyversion when set Keyvault properties for the first time, or clean up it by set keyvault properties again with keyversion as empty. ### Example 6: Set Encryption KeySource to "Microsoft.Storage" - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -StorageEncryption +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -StorageEncryption ``` This command set Encryption KeySource to "Microsoft.Storage" ### Example 7: Set NetworkRuleSet property of a Storage account with JSON - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -NetworkRuleSet (@{bypass="Logging,Metrics"; +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -NetworkRuleSet (@{bypass="Logging,Metrics"; ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"}, @{IPAddressOrRange="10.0.0.0/7";Action="allow"}); virtualNetworkRules=(@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"}, @@ -186,37 +158,28 @@ PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystora This command sets NetworkRuleSet property of a Storage account with JSON ### Example 8: Get NetworkRuleSet property from a Storage account, and set it to another Storage account - - - - -``` -PS C:\> $networkRuleSet = (Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount").NetworkRuleSet -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount2" -NetworkRuleSet $networkRuleSet +```powershell +$networkRuleSet = (Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount").NetworkRuleSet +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount2" -NetworkRuleSet $networkRuleSet ``` This first command gets NetworkRuleSet property from a Storage account, and the second command sets it to another Storage account ### Example 9: Upgrade a Storage account with Kind "Storage" or "BlobStorage" to "StorageV2" kind Storage account - - - - -``` -PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -UpgradeToStorageV2 +```powershell +Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -UpgradeToStorageV2 ``` The command upgrade a Storage account with Kind "Storage" or "BlobStorage" to "StorageV2" kind Storage account. ### Example 10: Update a Storage account by enable Azure Files AAD DS Authentication and set DefaultSharePermission. - - +```powershell +$account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -EnableAzureActiveDirectoryDomainServicesForFile $true -DefaultSharePermission StorageFileDataSmbShareOwner +$account.AzureFilesIdentityBasedAuth ``` -PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -EnableAzureActiveDirectoryDomainServicesForFile $true -DefaultSharePermission StorageFileDataSmbShareOwner - -PS C:\> $account.AzureFilesIdentityBasedAuth +```output DirectoryServiceOptions ActiveDirectoryProperties DefaultSharePermission ----------------------- ------------------------- ---------------------- AADDS Microsoft.Azure.Commands.Management.Storage.Models.PSActiveDirectoryProperties StorageFileDataSmbShareOwner @@ -382,12 +345,9 @@ LastKeyRotationTimestamp : 4/12/2021 8:17:57 AM This command first assigns System identity to the account, and give the system assigned identity access to the keyvault; then updates the Storage account to access Keyvault with system assigned identity. ### Example 17: Update both Keyvault and the user assigned identity to access keyvault - - - ```powershell # Update to another user assigned identity -PS C:\> $account = Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -IdentityType SystemAssignedUserAssigned -UserAssignedIdentityId $useridentity2 -KeyVaultUserAssignedIdentityId $useridentity2 +$account = Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -IdentityType SystemAssignedUserAssigned -UserAssignedIdentityId $useridentity2 -KeyVaultUserAssignedIdentityId $useridentity2 # Update to encrypt with another keyvault $account = Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -KeyVaultUri $keyvaultUri2 -KeyName $keyname2 -KeyVersion $keyversion2 @@ -397,26 +357,26 @@ This command first update the user assigned identity to access keyvault, then up To update both both Keyvault and the user assigned identity, we need update with the above 2 steps. ### Example 18: Update a Storage account with AllowCrossTenantReplication - - - ```powershell -PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -AllowCrossTenantReplication $false -EnableHttpsTrafficOnly $true +$account = Set-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -AllowCrossTenantReplication $false -EnableHttpsTrafficOnly $true + +$account.AllowCrossTenantReplication +``` -PS C:\> $account.AllowCrossTenantReplication +```output False ``` This command updates a Storage account by set AllowCrossTenantReplication to false, then show the updated account related properties. ### Example 18: Update a Storage account by enable PublicNetworkAccess - - - ```powershell -PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -PublicNetworkAccess Enabled +$account = Set-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -PublicNetworkAccess Enabled + +$account.PublicNetworkAccess +``` -PS C:\> $account.PublicNetworkAccess +```output Enabled ``` diff --git a/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md index be6df1aeeb62..4032e0bb9344 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md @@ -56,25 +56,25 @@ The **Set-AzStorageAccountManagementPolicy** cmdlet creates or modifies the mana ## EXAMPLES ### Example 1: Create or update the management policy of a Storage account with ManagementPolicy rule objects. - +```powershell +$action1 = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -DaysAfterCreationGreaterThan 100 +$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -DaysAfterLastTierChangeGreaterThan 30 +$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BaseBlobAction TierToCool -DaysAfterLastAccessTimeGreaterThan 30 -EnableAutoTierToHotFromCool +$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -SnapshotAction Delete -daysAfterCreationGreaterThan 100 +$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BlobVersionAction TierToArchive -daysAfterCreationGreaterThan 100 -DaysAfterLastTierChangeGreaterThan 14 +$filter1 = New-AzStorageAccountManagementPolicyFilter -PrefixMatch ab,cd +$rule1 = New-AzStorageAccountManagementPolicyRule -Name Test -Action $action1 -Filter $filter1 + +$action2 = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -daysAfterCreationGreaterThan 100 +$blobindexmatch1 = New-AzStorageAccountManagementPolicyBlobIndexMatchObject -Name "tag1" -Value "value1" +$blobindexmatch2 = New-AzStorageAccountManagementPolicyBlobIndexMatchObject -Name "tag2" -Value "value2" +$filter2 = New-AzStorageAccountManagementPolicyFilter -BlobType appendBlob,blockBlob -BlobIndexMatch $blobindexmatch1,$blobindexmatch2 +$rule2 = New-AzStorageAccountManagementPolicyRule -Name Test2 -Action $action2 -Filter $filter2 + +Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Rule $rule1,$rule2 ``` -PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -DaysAfterCreationGreaterThan 100 -PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -DaysAfterLastTierChangeGreaterThan 30 -PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BaseBlobAction TierToCool -DaysAfterLastAccessTimeGreaterThan 30 -EnableAutoTierToHotFromCool -PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -SnapshotAction Delete -daysAfterCreationGreaterThan 100 -PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BlobVersionAction TierToArchive -daysAfterCreationGreaterThan 100 -DaysAfterLastTierChangeGreaterThan 14 -PS C:\>$filter1 = New-AzStorageAccountManagementPolicyFilter -PrefixMatch ab,cd -PS C:\>$rule1 = New-AzStorageAccountManagementPolicyRule -Name Test -Action $action1 -Filter $filter1 - -PS C:\>$action2 = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -daysAfterCreationGreaterThan 100 -PS C:\>$blobindexmatch1 = New-AzStorageAccountManagementPolicyBlobIndexMatchObject -Name "tag1" -Value "value1" -PS C:\>$blobindexmatch2 = New-AzStorageAccountManagementPolicyBlobIndexMatchObject -Name "tag2" -Value "value2" -PS C:\>$filter2 = New-AzStorageAccountManagementPolicyFilter -BlobType appendBlob,blockBlob -BlobIndexMatch $blobindexmatch1,$blobindexmatch2 -PS C:\>$rule2 = New-AzStorageAccountManagementPolicyRule -Name Test2 -Action $action2 -Filter $filter2 - -PS C:\>Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Rule $rule1,$rule2 - +```output ResourceGroupName : myresourcegroup StorageAccountName : mystorageaccount Id : /subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/managementPolicies/default @@ -182,9 +182,8 @@ Rules : [ This command first create 2 ManagementPolicy rule objects, then creates or updates the management policy of a Storage account with the 2 ManagementPolicy rule objects. ### Example 2: Create or update the management policy of a Storage account with a Json format policy. - -``` -PS C:\>Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Policy (@{ +```powershell +Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Policy (@{ Rules=(@{ Enabled=$true; Name="Test"; @@ -229,8 +228,9 @@ PS C:\>Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" }) }) }) +``` - +```output ResourceGroupName : myresourcegroup StorageAccountName : mystorageaccount Id : /subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/managementPolicies/default @@ -350,8 +350,8 @@ Rules : [ This command creates or updates the management policy of a Storage account with a json format policy. ### Example 3: Get the management policy from a Storage account, then set it to another Storage account. -``` -PS C:\>$outputPolicy = Get-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" | Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" +```powershell +$outputPolicy = Get-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" | Set-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" ``` This command first gets the management policy from a Storage account, then set it to another Storage account. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md index cd4199aa9f31..8d41aa8f6914 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md @@ -49,14 +49,14 @@ The **Set-AzStorageBlobContent** cmdlet uploads a local file to an Azure Storage ## EXAMPLES ### Example 1: Upload a named file -``` +```powershell Set-AzStorageBlobContent -Container "ContosoUpload" -File ".\PlanningData" -Blob "Planning2015" ``` This command uploads the file that is named PlanningData to a blob named Planning2015. ### Example 2: Upload all files under the current folder -``` +```powershell Get-ChildItem -File -Recurse | Set-AzStorageBlobContent -Container "ContosoUploads" ``` @@ -64,7 +64,7 @@ This command uses the core Windows PowerShell cmdlet Get-ChildItem to get all th The **Set-AzStorageBlobContent** cmdlet uploads the files to the container named ContosoUploads. ### Example 3: Overwrite an existing blob -``` +```powershell Get-AzStorageBlob -Container "ContosoUploads" -Blob "Planning2015" | Set-AzStorageBlobContent -File "ContosoPlanning" ``` @@ -75,7 +75,7 @@ The command prompts you for confirmation. If you confirm the command, the cmdlet overwrites the existing blob. ### Example 4: Upload a file to a container by using the pipeline -``` +```powershell Get-AzStorageContainer -Container "ContosoUpload*" | Set-AzStorageBlobContent -File "ContosoPlanning" -Blob "Planning2015" ``` @@ -83,7 +83,7 @@ This command gets the container that starts with the string ContosoUpload by usi The command uploads the file that is named ContosoPlanning as Planning2015. ### Example 5: Upload a file to page blob with metadata and PremiumPageBlobTier as P10 -``` +```powershell $Metadata = @{"key" = "value"; "name" = "test"} Set-AzStorageBlobContent -File "ContosoPlanning" -Container "ContosoUploads" -Metadata $Metadata -BlobType Page -PremiumPageBlobTier P10 ``` @@ -93,13 +93,12 @@ The second command uploads the file that is named ContosoPlanning to the contain The blob includes the metadata stored in $Metadata, and has PremiumPageBlobTier as P10. ### Example 6: Upload a file to blob with specified blob properties, and set StandardBlobTier as Cool - - - +```powershell +$filepath = "c:\temp\index.html" +Set-AzStorageBlobContent -File $filepath -Container "contosouploads" -Properties @{"ContentType" = [System.Web.MimeMapping]::GetMimeMapping($filepath); "ContentMD5" = "i727sP7HigloQDsqadNLHw=="} -StandardBlobTier Cool ``` -PS C:\> $filepath = "c:\temp\index.html" -PS C:\> Set-AzStorageBlobContent -File $filepath -Container "contosouploads" -Properties @{"ContentType" = [System.Web.MimeMapping]::GetMimeMapping($filepath); "ContentMD5" = "i727sP7HigloQDsqadNLHw=="} -StandardBlobTier Cool +```output AccountName: storageaccountname, ContainerName: contosouploads Name BlobType Length ContentType LastModified AccessTier SnapshotTime IsDeleted VersionId @@ -111,13 +110,13 @@ This command uploads the file c:\temp\index.html to the container named contosou This command gets ContentType value set to blob properties by [System.Web.MimeMapping]::GetMimeMapping() API. ### Example 7: Upload a file to a blob with Encryption Scope - - +```powershell +$blob = Set-AzStorageBlobContent -File "mylocalfile" -Container "mycontainer" -Blob "myblob" -EncryptionScope "myencryptscope" +$blob.BlobProperties.EncryptionScope ``` -PS C:\> $blob = Set-AzStorageBlobContent -File "mylocalfile" -Container "mycontainer" -Blob "myblob" -EncryptionScope "myencryptscope" -PS C:\> $blob.BlobProperties.EncryptionScope +```output myencryptscope ``` diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md index 88a32403130e..aa40eccb797a 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md @@ -170,18 +170,16 @@ Test3 False containername Blob Csv Weekly This command creates or updates the blob inventory policy of a Storage account with a json format policy. ### Example 3: Get the blob inventory policy from a Storage account, then set it to another Storage account. - -``` -PS C:\>$policy = Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" | Set-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" +```powershell +$policy = Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" | Set-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" ``` This command first gets the blob inventory policy from a Storage account, then set it to another Storage account. The proeprties: Destination, Enabled, and Rules of the policy will be set to the destination account. ### Example 4: Get the blob inventory policy rules from a Storage account, then set it to another Storage account. - -``` -PS C:\>$policy = ,((Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount").Rules) | Set-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" -Disabled +```powershell +$policy = ,((Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount").Rules) | Set-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup2" -AccountName "mystorageaccount2" -Disabled ``` This command first gets the blob inventory policy from a Storage account, then set it's rules to another Storage account. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md index ee3fe082c20e..05aee1d7fa47 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md @@ -42,10 +42,11 @@ The **Set-AzStorageBlobTag** sets blob tags of a specific blob. ## EXAMPLES ### Example 1: Set blob tags on a specific blob - +```powershell +Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } ``` -PS C:\> Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } +```output Name Value ---- ----- tag2 value2 @@ -55,10 +56,11 @@ tag1 value1 This command sets blob tags on a specific blob. ### Example 2: Set blob tags on a specific blob with tag condition - +```powershell +Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } -TagCondition """tag1""='value1'" ``` -PS C:\> Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } -TagCondition """tag1""='value1'" +```output Name Value ---- ----- tag2 value2 diff --git a/src/Storage/Storage.Management/help/Set-AzStorageCORSRule.md b/src/Storage/Storage.Management/help/Set-AzStorageCORSRule.md index 8e21562cfe12..9ab2dfcf3962 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageCORSRule.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageCORSRule.md @@ -28,8 +28,8 @@ To see the current rules, use the Get-AzStorageCORSRule cmdlet. ## EXAMPLES ### Example 1: Assign CORS rules to the blob service -``` -PS C:\>$CorsRules = (@{ +```powershell +$CorsRules = (@{ AllowedHeaders=@("x-ms-blob-content-type","x-ms-blob-content-disposition"); AllowedOrigins=@("*"); MaxAgeInSeconds=30; @@ -40,7 +40,8 @@ PS C:\>$CorsRules = (@{ AllowedHeaders=@("x-ms-meta-target*","x-ms-meta-customheader"); MaxAgeInSeconds=30; AllowedMethods=@("Put")}) -PS C:\> Set-AzStorageCORSRule -ServiceType Blob -CorsRules $CorsRules + +Set-AzStorageCORSRule -ServiceType Blob -CorsRules $CorsRules ``` The first command assigns an array of rules to the $CorsRules variable. @@ -48,11 +49,11 @@ This command uses standard extends over several lines in this code block. The second command assigns the rules in $CorsRules to the Blob service type. ### Example 2: Change properties of a CORS rule for blob service -``` -PS C:\>$CorsRules = Get-AzStorageCORSRule -ServiceType Blob -PS C:\> $CorsRules[0].AllowedHeaders = @("x-ms-blob-content-type", "x-ms-blob-content-disposition") -PS C:\> $CorsRules[0].AllowedMethods = @("Get", "Connect", "Merge") -PS C:\> Set-AzStorageCORSRule -ServiceType Blob -CorsRules $CorsRules +```powershell +$CorsRules = Get-AzStorageCORSRule -ServiceType Blob +$CorsRules[0].AllowedHeaders = @("x-ms-blob-content-type", "x-ms-blob-content-disposition") +$CorsRules[0].AllowedMethods = @("Get", "Connect", "Merge") +Set-AzStorageCORSRule -ServiceType Blob -CorsRules $CorsRules ``` The first command gets the current CORS rules for the Blob type by using the **Get-AzStorageCORSRule** cmdlet. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageContainerAcl.md b/src/Storage/Storage.Management/help/Set-AzStorageContainerAcl.md index 06762c744290..9155cb73bfb3 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageContainerAcl.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageContainerAcl.md @@ -25,15 +25,15 @@ The **Set-AzStorageContainerAcl** cmdlet sets the public access permission to th ## EXAMPLES ### Example 1: Set azure storage container ACL by name -``` -PS C:\>Set-AzStorageContainerAcl -Container "Container01" -Permission Off -PassThru +```powershell +Set-AzStorageContainerAcl -Container "Container01" -Permission Off -PassThru ``` This command creates a container that has no public access. ### Example 2: Set azure storage container ACL by using the pipeline -``` -PS C:\>Get-AzStorageContainer container* | Set-AzStorageContainerAcl -Permission Blob -PassThru +```powershell +Get-AzStorageContainer container* | Set-AzStorageContainerAcl -Permission Blob -PassThru ``` This command gets all storage containers whose name starts with container and then passes the result on the pipeline to set the permission for them all to Blob access. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageContainerStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageContainerStoredAccessPolicy.md index 64f91ad97318..8c482b68c026 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageContainerStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageContainerStoredAccessPolicy.md @@ -27,8 +27,8 @@ The **Set-AzStorageContainerStoredAccessPolicy** cmdlet sets a stored access pol ## EXAMPLES ### Example 1: Set a stored access policy in a storage container with full permission -``` -PS C:\>Set-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy06" -Permission rwdl +```powershell +Set-AzStorageContainerStoredAccessPolicy -Container "MyContainer" -Policy "Policy06" -Permission rwdl ``` This command sets an access policy named Policy06 for storage container named MyContainer. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageFileContent.md b/src/Storage/Storage.Management/help/Set-AzStorageFileContent.md index 3f452733f09d..9805d358f6fd 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageFileContent.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageFileContent.md @@ -43,17 +43,17 @@ The **Set-AzStorageFileContent** cmdlet uploads the contents of a file to a file ## EXAMPLES ### Example 1: Upload a file in the current folder -``` -PS C:\>Set-AzStorageFileContent -ShareName "ContosoShare06" -Source "DataFile37" -Path "ContosoWorkingFolder/CurrentDataFile" +```powershell +Set-AzStorageFileContent -ShareName "ContosoShare06" -Source "DataFile37" -Path "ContosoWorkingFolder/CurrentDataFile" ``` This command uploads a file that is named DataFile37 in the current folder as a file that is named CurrentDataFile in the folder named ContosoWorkingFolder. ### Example 2: Upload all the files in the current folder -``` -PS C:\>$CurrentFolder = (Get-Item .).FullName -PS C:\> $Container = Get-AzStorageShare -Name "ContosoShare06" -PS C:\> Get-ChildItem -Recurse | Where-Object { $_.GetType().Name -eq "FileInfo"} | ForEach-Object { +```powershell +$CurrentFolder = (Get-Item .).FullName +$Container = Get-AzStorageShare -Name "ContosoShare06" +Get-ChildItem -Recurse | Where-Object { $_.GetType().Name -eq "FileInfo"} | ForEach-Object { $path=$_.FullName.Substring($Currentfolder.Length+1).Replace("\","/") Set-AzStorageFileContent -Share $Container -Source $_.FullName -Path $path -Force } @@ -69,8 +69,8 @@ The result has the same name and same relative position with regard to the other For more information about script blocks, type `Get-Help about_Script_Blocks`. ### Example 3: Upload a local file to an Azure file, and perserve the local File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the Azure file. -``` -PS C:\>Set-AzStorageFileContent -Source $localFilePath -ShareName sample -Path "dir1/file1" -PreserveSMBAttribute +```powershell +Set-AzStorageFileContent -Source $localFilePath -ShareName sample -Path "dir1/file1" -PreserveSMBAttribute ``` This example uploads a local file to an Azure file, and perserves the local File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the Azure file. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageQueueStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageQueueStoredAccessPolicy.md index d7dd5f7b04a4..c835fa5975ad 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageQueueStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageQueueStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **Set-AzStorageQueueStoredAccessPolicy** cmdlet sets a stored access policy ## EXAMPLES ### Example 1: Set a stored access policy in the queue with full permission -``` -PS C:\> Set-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy07" -Permission arup +```powershell +Set-AzStorageQueueStoredAccessPolicy -Queue "MyQueue" -Policy "Policy07" -Permission arup ``` This command sets an access policy named Policy07 for storage queue named MyQueue. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageServiceLoggingProperty.md b/src/Storage/Storage.Management/help/Set-AzStorageServiceLoggingProperty.md index 46e37ff25bb7..e0f5c0c7656f 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageServiceLoggingProperty.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageServiceLoggingProperty.md @@ -25,8 +25,8 @@ The **Set-AzStorageServiceLoggingProperty** cmdlet modifies logging for Azure St ## EXAMPLES ### Example 1: Modify logging properties for the Blob service -``` -C:\PS>Set-AzStorageServiceLoggingProperty -ServiceType Blob -LoggingOperations Read,Write -PassThru -RetentionDays 10 -Version 1.0 +```powershell +Set-AzStorageServiceLoggingProperty -ServiceType Blob -LoggingOperations Read,Write -PassThru -RetentionDays 10 -Version 1.0 ``` This command modifies version 1.0 logging for blob storage to include read and write operations. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageServiceMetricsProperty.md b/src/Storage/Storage.Management/help/Set-AzStorageServiceMetricsProperty.md index 329884b3e48d..6b69e94c9f69 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageServiceMetricsProperty.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageServiceMetricsProperty.md @@ -25,8 +25,8 @@ The **Set-AzStorageServiceMetricsProperty** cmdlet modifies metrics properties f ## EXAMPLES ### Example 1: Modify metrics properties for the Blob service -``` -C:\PS>Set-AzStorageServiceMetricsProperty -ServiceType Blob -MetricsType Hour -MetricsLevel Service -PassThru -RetentionDays 10 -Version 1.0 +```powershell +Set-AzStorageServiceMetricsProperty -ServiceType Blob -MetricsType Hour -MetricsLevel Service -PassThru -RetentionDays 10 -Version 1.0 ``` This command modifies version 1.0 metrics for blob storage to a level of Service. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageShareQuota.md b/src/Storage/Storage.Management/help/Set-AzStorageShareQuota.md index 4bdcbeb4c95a..dedc212903a4 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageShareQuota.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageShareQuota.md @@ -33,8 +33,8 @@ The **Set-AzStorageShareQuota** cmdlet sets the storage capacity for a specified ## EXAMPLES ### Example 1: Set the storage capacity of a share -``` -PS C:\>Set-AzStorageShareQuota -ShareName "ContosoShare01" -Quota 1024 +```powershell +Set-AzStorageShareQuota -ShareName "ContosoShare01" -Quota 1024 ``` This command sets the storage capacity for a share named ContosoShare01 to 1024 GB. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageShareStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageShareStoredAccessPolicy.md index 1c96ceb82cf7..c522bc62517e 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageShareStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageShareStoredAccessPolicy.md @@ -27,8 +27,8 @@ The **Set-AzStorageShareStoredAccessPolicy** cmdlet updates stored access policy ## EXAMPLES ### Example 1: Update a stored access policy in Storage share -``` -PS C:\>Set-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" -Permission "rwdl" +```powershell +Set-AzStorageShareStoredAccessPolicy -ShareName "ContosoShare" -Policy "GeneralPolicy" -Permission "rwdl" ``` This command updates a stored access policy that has full permission in a share. diff --git a/src/Storage/Storage.Management/help/Set-AzStorageTableStoredAccessPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageTableStoredAccessPolicy.md index b95dc72ea686..3a113b4a50ae 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageTableStoredAccessPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageTableStoredAccessPolicy.md @@ -25,8 +25,8 @@ The **Set-AzStorageTableStoredAccessPolicy** cmdlet set the stored access policy ## EXAMPLES ### Example 1: Set a stored access policy in table with full permission -``` -PS C:\>Set-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy08" -Permission raud +```powershell +Set-AzStorageTableStoredAccessPolicy -Table "MyTable" -Policy "Policy08" -Permission raud ``` This command sets an access policy named Policy08 for storage table named MyTable. diff --git a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md index 0b0c4a78f3a4..e4652d3c0d36 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageBlobCopy.md @@ -122,14 +122,14 @@ The **Start-AzStorageBlobCopy** cmdlet starts to copy a blob. ## EXAMPLES ### Example 1: Copy a named blob -``` +```powershell Start-AzStorageBlobCopy -SrcBlob "ContosoPlanning2015" -DestContainer "ContosoArchives" -SrcContainer "ContosoUploads" ``` This command starts the copy operation of the blob named ContosoPlanning2015 from the container named ContosoUploads to the container named ContosoArchives. ### Example 2: Get a container to specify blobs to copy -``` +```powershell Get-AzStorageContainer -Name "ContosoUploads" | Start-AzStorageBlobCopy -SrcBlob "ContosoPlanning2015" -DestContainer "ContosoArchives" ``` @@ -139,7 +139,7 @@ The previous cmdlet provides the source container. The *DestContainer* parameter specifies ContosoArchives as the destination container. ### Example 3: Get all blobs in a container and copy them -``` +```powershell Get-AzStorageBlob -Container "ContosoUploads" | Start-AzStorageBlobCopy -DestContainer "ContosoArchives" ``` @@ -147,7 +147,7 @@ This command gets the blobs in the container named ContosoUploads, by using the That cmdlet starts the copy operation of the blobs to the container named ContosoArchives. ### Example 4: Copy a blob specified as an object -``` +```powershell $SrcBlob = Get-AzStorageBlob -Container "ContosoUploads" -Blob "ContosoPlanning2015" $DestBlob = Get-AzStorageBlob -Container "ContosoArchives" -Blob "ContosoPlanning2015Archived" Start-AzStorageBlobCopy -ICloudBlob $SrcBlob.ICloudBlob -DestICloudBlob $DestBlob.ICloudBlob @@ -161,7 +161,7 @@ The last command starts the copy operation from the source container to the dest The command uses standard dot notation to specify the **ICloudBlob** objects for the $SrcBlob and $DestBlob blobs. ### Example 5: Copy a blob from a URI -``` +```powershell $Context = New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" Start-AzStorageBlobCopy -AbsoluteUri "http://www.contosointernal.com/planning" -DestContainer "ContosoArchive" -DestBlob "ContosoPlanning2015" -DestContext $Context ``` @@ -172,7 +172,7 @@ The command starts the copy operation to the destination context stored in $Cont There are no source storage context, so the source Uri must have access to the source object. E.g: if the source is a none public Azure blob, the Uri should contain SAS token which has read access to the blob. ### Example 6: Copy a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Hot, RehydratePriority as High -``` +```powershell Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Hot -RehydratePriority High ``` diff --git a/src/Storage/Storage.Management/help/Start-AzStorageBlobIncrementalCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageBlobIncrementalCopy.md index 8337822f7f5f..39c061bce26f 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageBlobIncrementalCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageBlobIncrementalCopy.md @@ -61,30 +61,30 @@ See more details of the feature in https://docs.microsoft.com/rest/api/storagese ## EXAMPLES ### Example 1: Start Incremental Copy Operation by blob name and snapshot time -``` -PS C:\>Start-AzStorageBlobIncrementalCopy -SrcContainer container1 -SrcBlob blob1 -SrcBlobSnapshotTime "04/07/2017 09:55:36.1190229 AM +00:00" -DestContainer container2 -DestBlob blob2 +```powershell +Start-AzStorageBlobIncrementalCopy -SrcContainer container1 -SrcBlob blob1 -SrcBlobSnapshotTime "04/07/2017 09:55:36.1190229 AM +00:00" -DestContainer container2 -DestBlob blob2 ``` This command start Incremental Copy Operation by blob name and snapshot time ### Example 2: Start Incremental copy operation using source uri -``` -PS C:\>Start-AzStorageBlobIncrementalCopy -AbsoluteUri "http://www.somesite.com/somefile?snapshot=2017-04-07T10:05:40.2126635Z" -DestContainer container -DestBlob blob -DestContext $context +```powershell +Start-AzStorageBlobIncrementalCopy -AbsoluteUri "http://www.somesite.com/somefile?snapshot=2017-04-07T10:05:40.2126635Z" -DestContainer container -DestBlob blob -DestContext $context ``` This command start Incremental Copy Operation using source uri ### Example 3: Start Incremental copy operation using container pipeline from GetAzureStorageContainer -``` -PS C:\>Get-AzStorageContainer -Container container1 | Start-AzStorageBlobIncrementalCopy -SrcBlob blob -SrcBlobSnapshotTime "04/07/2017 09:55:36.1190229 AM +00:00" -DestContainer container2 +```powershell +Get-AzStorageContainer -Container container1 | Start-AzStorageBlobIncrementalCopy -SrcBlob blob -SrcBlobSnapshotTime "04/07/2017 09:55:36.1190229 AM +00:00" -DestContainer container2 ``` This command start Incremental Copy Operation using container pipeline from GetAzureStorageContainer ### Example 4: start Incremental copy operation from CloudPageBlob object to destination blob with blob name -``` -PS C:\>$srcBlobSnapshot = Get-AzStorageBlob -Container container1 -prefix blob1| Where-Object ({$_.ICloudBlob.IsSnapshot})[0] -PS C:\>Start-AzStorageBlobIncrementalCopy -CloudBlob $srcBlobSnapshot.ICloudBlob -DestContainer container2 -DestBlob blob2 +```powershell +$srcBlobSnapshot = Get-AzStorageBlob -Container container1 -prefix blob1| Where-Object ({$_.ICloudBlob.IsSnapshot})[0] +Start-AzStorageBlobIncrementalCopy -CloudBlob $srcBlobSnapshot.ICloudBlob -DestContainer container2 -DestBlob blob2 ``` This command start Incremental Copy Operation from CloudPageBlob object to destination blob with blob name diff --git a/src/Storage/Storage.Management/help/Start-AzStorageFileCopy.md b/src/Storage/Storage.Management/help/Start-AzStorageFileCopy.md index 8c4ae95c63c3..92bc603a80b5 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageFileCopy.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageFileCopy.md @@ -99,16 +99,16 @@ This cmdlet will trigger asynchronous blob copy, the copy process is handled by ## EXAMPLES ### Example 1: Start copy operation from file to file by using share name and file name -``` -PS C:\>Start-AzStorageFileCopy -SrcShareName "ContosoShare01" -SrcFilePath "FilePath01" -DestShareName "ContosoShare02" -DestFilePath "FilePath02" +```powershell +Start-AzStorageFileCopy -SrcShareName "ContosoShare01" -SrcFilePath "FilePath01" -DestShareName "ContosoShare02" -DestFilePath "FilePath02" ``` This command starts a copy operation from file to file. The command specifies share name and file name ### Example 2: Start copy operation from blob to file by using container name and blob name -``` -PS C:\>Start-AzStorageFileCopy -SrcContainerName "ContosoContainer01" -SrcBlobName "ContosoBlob01" -DestShareName "ContosoShare" -DestFilePath "FilePath02" +```powershell +Start-AzStorageFileCopy -SrcContainerName "ContosoContainer01" -SrcBlobName "ContosoBlob01" -DestShareName "ContosoShare" -DestFilePath "FilePath02" ``` This command starts a copy operation from blob to file. diff --git a/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md b/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md index a63f4f5afe79..65ce1111d3d2 100644 --- a/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md +++ b/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md @@ -30,9 +30,11 @@ The **Stop-AzStorageAccountHierarchicalNamespaceUpgrade** cmdlet can aborts an o ## EXAMPLES ### Example 1: Abort HierarchicalNamespace upgrade task on a stroage account - +```powershell +Stop-AzStorageAccountHierarchicalNamespaceUpgrade -ResourceGroupName $rgname -Name $accountName -Force -PassThru ``` -PS C:\> Stop-AzStorageAccountHierarchicalNamespaceUpgrade -ResourceGroupName $rgname -Name $accountName -Force -PassThru + +```output True ``` diff --git a/src/Storage/Storage.Management/help/Stop-AzStorageBlobCopy.md b/src/Storage/Storage.Management/help/Stop-AzStorageBlobCopy.md index 5f32d12aad60..c86de8d7b379 100644 --- a/src/Storage/Storage.Management/help/Stop-AzStorageBlobCopy.md +++ b/src/Storage/Storage.Management/help/Stop-AzStorageBlobCopy.md @@ -43,22 +43,22 @@ The **Stop-AzStorageBlobCopy** cmdlet stops a copy operation to the specified de ## EXAMPLES ### Example 1: Stop copy operation by name -``` -PS C:\>Stop-AzStorageBlobCopy -Container "ContainerName" -Blob "BlobName" -CopyId "CopyID" +```powershell +Stop-AzStorageBlobCopy -Container "ContainerName" -Blob "BlobName" -CopyId "CopyID" ``` This command stops the copy operation by name. ### Example 2: Stop copy operation by using the pipeline -``` -PS C:\>Get-AzStorageContainer container* | Stop-AzStorageBlobCopy -Blob "BlobName" +```powershell +Get-AzStorageContainer container* | Stop-AzStorageBlobCopy -Blob "BlobName" ``` This command stops the copy operation by passing the container on the pipeline from **Get-AzStorageContainer**. ### Example 3: Stop copy operation by using the pipeline and Get-AzStorageBlob -``` -PS C:\>Get-AzStorageBlob -Container "ContainerName" | Stop-AzStorageBlobCopy -Force +```powershell +Get-AzStorageBlob -Container "ContainerName" | Stop-AzStorageBlobCopy -Force ``` This example stops the copy operation by passing the container on the pipeline from the Get-AzStorageBlob cmdlet. diff --git a/src/Storage/Storage.Management/help/Stop-AzStorageFileCopy.md b/src/Storage/Storage.Management/help/Stop-AzStorageFileCopy.md index f691ab26d859..d0001ec46dad 100644 --- a/src/Storage/Storage.Management/help/Stop-AzStorageFileCopy.md +++ b/src/Storage/Storage.Management/help/Stop-AzStorageFileCopy.md @@ -35,8 +35,8 @@ The **Stop-AzStorageFileCopy** cmdlet stops copying a file to a destination file ## EXAMPLES ### Example 1: Stop a copy operation -``` -PS C:\>Stop-AzStorageFileCopy -ShareName "ContosoShare" -FilePath "FilePath" -CopyId "CopyId" +```powershell +Stop-AzStorageFileCopy -ShareName "ContosoShare" -FilePath "FilePath" -CopyId "CopyId" ``` This command stops copying a file that has the specified name. diff --git a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md index 5d36c4cc53c5..fcc319c04600 100644 --- a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md +++ b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md @@ -26,13 +26,14 @@ The input ACL will merge the the original ACL: If ACL entry with same AccessCont ## EXAMPLES ### Example 1: Update ACL recursively on a root directiry of filesystem - +```powershell +$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx +$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl +$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl +Update-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Acl $acl -Context $ctx ``` -PS C:\>$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -PS C:\>$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl -PS C:\>$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl -PS C:\> Update-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Acl $acl -Context $ctx +```output FailedEntries : TotalDirectoriesSuccessfulCount : 7 TotalFilesSuccessfulCount : 5 @@ -78,7 +79,7 @@ This command first updateds ACL recursively to a directory and failed, then resu ### Example 3: Update ACL recursively chunk by chunk -``` +```powershell $ContinueOnFailure = $true # Set it to $false if want to terminate the operation quickly on encountering failures $token = $null $TotalDirectoriesSuccess = 0 diff --git a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md index 63d2b4444137..db6eb4157b34 100644 --- a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md @@ -35,13 +35,14 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Create an ACL object with 3 ACL entry, and update ACL to all items in a Filesystem recursively - +```powershell +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl +Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" -Recurse | Update-AzDataLakeGen2Item -ACL $acl ``` -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl -PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission "rw-" -InputObject $acl -PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" -Recurse | Update-AzDataLakeGen2Item -ACL $acl +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group @@ -130,17 +131,18 @@ AccessTierChangedOn : 1/1/0001 12:00:00 AM +00:00 This command updates all properties on a file (ACL, permission,owner, group, metadata, property can be updated with any conbination), and show them in Powershell console. ### Example 3: Add an ACL entry to a directory - -``` +```powershell ## Get the origin ACL -PS C:\> $acl = (Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path 'dir1/dir3/').ACL +$acl = (Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path 'dir1/dir3/').ACL # Update permission of a new ACL entry (if ACL entry with same AccessControlType/EntityId/DefaultScope not exist, will add a new ACL entry, else update permission of existing ACL entry) -PS C:\> $acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission rw- -InputObject $acl +$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission rw- -InputObject $acl # set the new acl to the directory -PS C:\> Update-AzDataLakeGen2Item -FileSystem "filesystem1" -Path 'dir1/dir3/' -ACL $acl +Update-AzDataLakeGen2Item -FileSystem "filesystem1" -Path 'dir1/dir3/' -ACL $acl +``` +```output FileSystem Name: filesystem1 Path IsDirectory Length LastModified Permissions Owner Group diff --git a/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md index af484768e869..25986d1cd8c4 100644 --- a/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md @@ -38,23 +38,23 @@ The **Update-AzRmStorageContainer** cmdlet modifies a Storage blob container ## EXAMPLES ### Example 1: Modifies a Storage blob container's metadata and public access with Storage account name and container name -``` -PS C:\>Update-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -PublicAccess Container -Metadata @{tag0="value0";tag1="value1"} +```powershell +Update-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -ContainerName "myContainer" -PublicAccess Container -Metadata @{tag0="value0";tag1="value1"} ``` This command modifies a Storage blob container's metadata and public access with Storage account name and container name. ### Example 2: Disable public access on a Storage blob container with Storage account object and container name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -PS C:\>Update-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" -PublicAccess None +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" +Update-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer" -PublicAccess None ``` This command disables public access on a Storage blob container with Storage account object and container name. ### Example 3: Set public access as Blob for all Storage blob containers in a Storage account with pipeline -``` -PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Update-AzRmStorageContainer -PublicAccess Blob +```powershell +Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" | Update-AzRmStorageContainer -PublicAccess Blob ``` This command set public access as Blob for all Storage blob containers in a Storage account with pipeline. diff --git a/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md index 8e5b99a23957..605ee8a49407 100644 --- a/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md @@ -69,18 +69,19 @@ tag1 value1 This command modifies a Storage file share's metadata and share quota with Storage account name and share name, and show the modify result with the returned file share object. ### Example 2: Modifies metadata on a Storage file share with Storage account object and share name -``` -PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" -PS C:\>$share = Update-AzRmStorageShare -StorageAccount $accountObject -Name "myshare" -Metadata @{tag0="value0";tag1="value1"} +```powershell +$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -StorageAccountName "myStorageAccount" +$share = Update-AzRmStorageShare -StorageAccount $accountObject -Name "myshare" -Metadata @{tag0="value0";tag1="value1"} ``` This command modifies metadata on a Storage file share with Storage account object and share name. ### Example 3: Modifies share quota for all Storage file shares in a Storage account with pipeline - +```powershell +Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Update-AzRmStorageShare -QuotaGiB 5000 ``` -PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Update-AzRmStorageShare -QuotaGiB 5000 +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes @@ -92,10 +93,11 @@ share2 5000 This command modifies share quota as 5000 GiB for all Storage file shares in a Storage account with pipeline. ### Example 4: Modify a Storage file share with accesstier as Cool - +```powershell +$share = Update-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -AccessTier Cool ``` -PS C:\>$share = Update-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -AccessTier Cool +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name QuotaGiB EnabledProtocols AccessTier Deleted Version ShareUsageBytes diff --git a/src/Storage/Storage.Management/help/Update-AzStorageAccountNetworkRuleSet.md b/src/Storage/Storage.Management/help/Update-AzStorageAccountNetworkRuleSet.md index b2c4ff79f64f..a41ff9bbf76d 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageAccountNetworkRuleSet.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageAccountNetworkRuleSet.md @@ -25,24 +25,24 @@ The **Update-AzStorageAccountNetworkRuleSet** cmdlet updates the NetworkRule pro ## EXAMPLES ### Example 1: Update all properties of NetworkRule, input Rules with JSON -``` -PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -Bypass Logging,Metrics -DefaultAction Allow -IpRule (@{IPAddressOrRange="10.0.0.0/7";Action="allow"},@{IPAddressOrRange="28.2.0.0/16";Action="allow"}) - -VirtualNetworkRule (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"},@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualN - etworks/vnet2/subnets/subnet2";Action="allow"}) -ResourceAccessRule (@{ResourceId=$ResourceId1;TenantId=$tenantId1},@{ResourceId=$ResourceId2;TenantId=$tenantId1}) +```powershell +Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -Bypass Logging,Metrics -DefaultAction Allow -IpRule (@{IPAddressOrRange="10.0.0.0/7";Action="allow"},@{IPAddressOrRange="28.2.0.0/16";Action="allow"}) ` +-VirtualNetworkRule (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"}, +@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2";Action="allow"}) -ResourceAccessRule (@{ResourceId=$ResourceId1;TenantId=$tenantId1},@{ResourceId=$ResourceId2;TenantId=$tenantId1}) ``` This command update all properties of NetworkRule, input Rules with JSON. ### Example 2: Update Bypass property of NetworkRule -``` -PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -Bypass AzureServices,Metrics +```powershell +Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -Bypass AzureServices,Metrics ``` This command update Bypass property of NetworkRule (other properties won't change). ### Example 3: Clean up rules of NetworkRule of a Storage account -``` -PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IpRule @() -VirtualNetworkRule @() -ResourceAccessRule @() +```powershell +Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IpRule @() -VirtualNetworkRule @() -ResourceAccessRule @() ``` This command clean up rules of NetworkRule of a Storage account (other properties not change). diff --git a/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md b/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md index ad5b052294bb..aa08c5dd3deb 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md @@ -40,10 +40,11 @@ The **Update-AzStorageBlobServiceProperty** cmdlet modifies the service properti ## EXAMPLES ### Example 1: Set Blob service DefaultServiceVersion to 2018-03-28 - +```powershell +Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -DefaultServiceVersion 2018-03-28 ``` -C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -DefaultServiceVersion 2018-03-28 +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup DefaultServiceVersion : 2018-03-28 @@ -59,10 +60,11 @@ IsVersioningEnabled : This command sets the DefaultServiceVersion of Blob Service to 2018-03-28. ### Example 2: Enable Changefeed on Blob service of a Storage account with ChangeFeedRetentionInDays as 5 days - +```powershell +Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableChangeFeed $true -ChangeFeedRetentionInDays 5 ``` -C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableChangeFeed $true -ChangeFeedRetentionInDays 5 +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup DefaultServiceVersion : @@ -82,10 +84,11 @@ The serialized changes are persisted as an Apache Avro file and can be processed If not specify ChangeFeedRetentionInDays, will get null value in service properties, indicates an infinite retention of the change feed. ### Example 3: Enable Versioning on Blob service of a Storage account - +```powershell +Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -IsVersioningEnabled $true ``` -C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -IsVersioningEnabled $true +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup DefaultServiceVersion : diff --git a/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md index 6fa4b50a6430..fa7e97f0c152 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md @@ -58,10 +58,11 @@ The **Update-AzStorageEncryptionScope** cmdlet modifies an encryption scope for ## EXAMPLES ### Example 1: Disable an encryption scope - +```powershell +Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Disabled ``` -PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Disabled +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption @@ -72,10 +73,11 @@ testscope Disabled Microsoft.Storage This command disables an encryption scope. ### Example 2: Enable an encryption scope - +```powershell +Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Enabled ``` -PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Enabled +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption @@ -86,10 +88,11 @@ testscope Enabled Microsoft.Storage This command enables an encryption scope. ### Example 3: Update an encryption scope to use Storage Encryption - +```powershell +Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption ``` -PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption @@ -100,10 +103,11 @@ testscope Enabled Microsoft.Storage This command updates an encryption scope to use Storage Encryption. ### Example 4: Update an encryption scope to use Keyvault Encryption - +```powershell +Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -KeyvaultEncryption -KeyUri "https://keyvalutname.vault.azure.net:443/keys/keyname/34a0ba563b4243d9a0ef2b1d3c0c7d57" ``` -PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -KeyvaultEncryption -KeyUri "https://keyvalutname.vault.azure.net:443/keys/keyname/34a0ba563b4243d9a0ef2b1d3c0c7d57" +```output ResourceGroupName: myresourcegroup, StorageAccountName: mystorageaccount Name State Source KeyVaultKeyUri RequireInfrastructureEncryption diff --git a/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md b/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md index 718fc1071bd5..939785b759cc 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md @@ -45,10 +45,11 @@ The **Update-AzStorageFileServiceProperty** cmdlet modifies the service properti ## EXAMPLES ### Example 1: Enable File share softdelete - ```powershell -PS C:\> Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableShareDeleteRetentionPolicy $true -ShareRetentionDays 5 +Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableShareDeleteRetentionPolicy $true -ShareRetentionDays 5 +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup ShareDeleteRetentionPolicy.Enabled : True @@ -63,10 +64,11 @@ ProtocolSettings.Smb.ChannelEncryption : This command enables File share softdelete delete with retention days as 5 ### Example 2: Enable Smb Multichannel - ```powershell -PS C:\> Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableSmbMultichannel $true +Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableSmbMultichannel $true +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup ShareDeleteRetentionPolicy.Enabled : True @@ -81,14 +83,15 @@ ProtocolSettings.Smb.ChannelEncryption : This command enables Smb Multichannel, only supported on Premium FileStorage account. ### Example 3: Updates secure smb settings - ```powershell -PS C:\> Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` +Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` -SMBProtocolVersion SMB2.1,SMB3.0,SMB3.1.1 ` -SMBAuthenticationMethod Kerberos,NTLMv2 ` -SMBKerberosTicketEncryption RC4-HMAC,AES-256 ` -SMBChannelEncryption AES-128-CCM,AES-128-GCM,AES-256-GCM +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup ShareDeleteRetentionPolicy.Enabled : True @@ -103,14 +106,15 @@ ProtocolSettings.Smb.ChannelEncryption : {AES-128-CCM, AES-128-GCM, AES-2 This command updates secure smb settings. ### Example 4: Clear secure smb settings - ```powershell -PS C:\> Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` +Update-AzStorageFileServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" ` -SMBProtocolVersion @() ` -SMBAuthenticationMethod @() ` -SMBKerberosTicketEncryption @() ` -SMBChannelEncryption @() +``` +```output StorageAccountName : mystorageaccount ResourceGroupName : myresourcegroup ShareDeleteRetentionPolicy.Enabled : True diff --git a/src/Storage/Storage.Management/help/Update-AzStorageServiceProperty.md b/src/Storage/Storage.Management/help/Update-AzStorageServiceProperty.md index ea161d920cf9..713f08f43615 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageServiceProperty.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageServiceProperty.md @@ -24,8 +24,8 @@ The **Update-AzStorageServiceProperty** cmdlet modifies the properties for the A ## EXAMPLES ### Example 1: Set Blob Service DefaultServiceVersion to 2017-04-17 -``` -C:\PS>Update-AzStorageServiceProperty -ServiceType Blob -DefaultServiceVersion 2017-04-17 +```powershell +Update-AzStorageServiceProperty -ServiceType Blob -DefaultServiceVersion 2017-04-17 ``` This command Set the DefaultServiceVersion of Blob Service to 2017-04-17