Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Fix help file format per static analysis result #20774

Merged
merged 8 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ The **Add-AzStorageAccountNetworkRule** cmdlet adds IpRules or VirtualNetworkRul
## EXAMPLES

### Example 1: Add several IpRules with IPAddressOrRange
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>$subnet = Get-AzVirtualNetwork -ResourceGroupName "myResourceGroup" -Name "myvirtualnetwork" | Get-AzVirtualNetworkSubnetConfig
PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -VirtualNetworkResourceId $subnet[0].Id
Expand All @@ -73,6 +75,7 @@ PS C:\>Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Nam
This command add a VirtualNetworkRule with VirtualNetworkResourceID.

### Example 3: Add VirtualNetworkRules with VirtualNetworkRule Objects from another account
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> $networkrule = Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1"
PS C:\> Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2" -VirtualNetworkRule $networkrule.VirtualNetworkRules
Expand All @@ -81,20 +84,23 @@ PS C:\> Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Na
This command add VirtualNetworkRules with VirtualNetworkRule Objects from another account.

### Example 4: Add several IpRule with IpRule objects, input with JSON
<!-- Skip: Output cannot be splitted from code -->
```
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"})
```

This command add several IpRule with IpRule objects, input with JSON.

### Example 5: Add a resource access rule
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> (Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount1").ResourceAccessRules | Add-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -Name "mystorageaccount2"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ The **Close-AzStorageFileHandle** cmdlet closes file handles of a file share, o
## EXAMPLES

### Example 1: Close all file handles on a file
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> 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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive | Where-Object {$_.OpenTime.DateTime.AddDays(1) -lt (Get-Date)} | Close-AzStorageFileHandle -ShareName "mysharename"
```
Expand All @@ -89,6 +91,7 @@ PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Re
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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -CloseAll -Recursive
```
Expand Down
5 changes: 5 additions & 0 deletions src/Storage/Storage.Management/help/Copy-AzStorageBlob.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ The **Copy-AzStorageBlob** cmdlet copies a blob synchronously, currently only su
## EXAMPLES

### Example 1: Copy a named blob to another
<!-- Skip: Output cannot be splitted from code -->
```
$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
<!-- Skip: Output cannot be splitted from code -->
```
$srcBlob = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $ctx
$destBlob = $srcBlob | Copy-AzStorageBlob -DestContainer "destcontainername" -DestBlob "destblobname"
Expand All @@ -57,6 +59,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
<!-- Skip: Output cannot be splitted from code -->
```
$srcBlobUri = New-AzStorageBlobSASToken -Container $srcContainerName -Blob $srcBlobName -Permission rt -ExpiryTime (Get-Date).AddDays(7) -FullUri
$destBlob = Copy-AzStorageBlob -AbsoluteUri $srcBlobUri -DestContainer "destcontainername" -DestBlob "destblobname"
Expand All @@ -65,13 +68,15 @@ $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
<!-- Skip: Output cannot be splitted from code -->
```
$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
<!-- Skip: Output cannot be splitted from code -->
```
$srcBlob = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $ctx
$destBlob = Copy-AzStorageBlob -SrcContainer "sourcecontainername" -SrcBlob "srcblobname" -DestContainer "destcontainername" -DestBlob "destblobname" -DestBlobType "Append" -DestContext $destCtx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The **Disable-AzStorageBlobDeleteRetentionPolicy** cmdlet disables delete retent
## EXAMPLES

### Example 1: Disable last access time tracking for the Blob service
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Disable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The **Disable-AzStorageBlobRestorePolicy** cmdlet disables Blob Restore Policy f
## EXAMPLES

### Example 1: Disables Blob Restore Policy for the Azure Storage Blob service on a Storage account
<!-- Skip: Output cannot be splitted from code -->
```powershell
PS C:\> Disable-AzStorageBlobRestorePolicy -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The **Disable-AzStorageDeleteRetentionPolicy** cmdlet disables delete retention
## EXAMPLES

### Example 1: Disable delete retention policy for the Blob service
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Disable-AzStorageDeleteRetentionPolicy
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The **Disable-AzStorageStaticWebsite** cmdlet disables static website for the Az
## EXAMPLES

### Example 1: Disable static website for a Azure Storage account
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Disable-AzStorageStaticWebsite
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The **Enable-AzStorageDeleteRetentionPolicy** cmdlet enables delete retention po
## EXAMPLES

### Example 1: Enable delete retention policy for the Blob service
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Enable-AzStorageDeleteRetentionPolicy -RetentionDays 3
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The **Enable-AzStorageStaticWebsite** cmdlet enables static website for the Azur
## EXAMPLES

### Example 1: Enable static website for the Azure Storage account
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Enable-AzStorageStaticWebsite -IndexDocument $indexdoc -ErrorDocument404Path $errordoc
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ 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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> $MaxReturn = 1000
PS C:\> $FileSystemName = "filesystem1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,23 @@ 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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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.
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
PS C:\>Get-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "myContainer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ The **Get-AzRmStorageContainerImmutabilityPolicy** cmdlet gets ImmutabilityPolic
## EXAMPLES

### Example 1: Get ImmutabilityPolicy of a Storage blob container with Storage account name and container name
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>$accountObject = Get-AzStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject -ContainerName "myContainer"
Expand All @@ -51,6 +53,7 @@ PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -StorageAccount $accountObject
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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>$containerObject = Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Name "myContainer"
PS C:\>Get-AzRmStorageContainerImmutabilityPolicy -Container $containerObject
Expand Down
3 changes: 3 additions & 0 deletions src/Storage/Storage.Management/help/Get-AzStorageAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ The **Get-AzStorageAccount** cmdlet gets a specified Storage account or all of t
## EXAMPLES

### Example 1: Get a specified Storage account
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount"
```

This command gets the specified Storage account.

### Example 2: Get all Storage accounts in a resource group
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageAccount
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The **Get-AzStorageAccountKey** cmdlet gets the access keys for an Azure Storage
## EXAMPLES

### Example 1: Get the access keys for a Storage account
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount"
```
Expand All @@ -47,6 +48,7 @@ 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)
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" -ListKerbKey
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The **Get-AzStorageAccountNameAvailability** cmdlet checks whether the name of a
## EXAMPLES

### Example 1: Check availability of a Storage account name
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageAccountNameAvailability -Name 'contosostorage03'
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The **Get-AzStorageAccountNetworkRuleSet** cmdlet gets the NetworkRule property
## EXAMPLES

### Example 1: Get NetworkRule property of a specified Storage account
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\> Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "rg1" -Name "mystorageaccount"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ It should run on the copy destination blob.
## EXAMPLES

### Example 1: Get the copy status of a blob
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>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
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Get-AzStorageBlob -Blob "ContosoPlanning2015" -Container "ContosoUploads" | Get-AzStorageBlobCopyState
```
Expand All @@ -56,6 +58,7 @@ This command gets the blob named ContosoPlanning2015 in the container named Cont
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
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS>Get-AzStorageContainer -Name "ContosoUploads" | Get-AzStorageBlobCopyState -Blob "ContosoPlanning2015"
```
Expand All @@ -64,6 +67,7 @@ This command gets the container named by using the **Get-AzStorageBlob** 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
<!-- Skip: Output cannot be splitted from code -->
```
C:\PS> $destBlob = Start-AzStorageBlobCopy -SrcContainer "contosouploads" -SrcBlob "ContosoPlanning2015" -DestContainer "contosouploads2" -DestBlob "ContosoPlanning2015_copy"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The **Get-AzStorageCORSRule** cmdlet gets Cross-Origin Resource Sharing (CORS) r
## EXAMPLES

### Example 1: Get CORS rules of blob service
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageCORSRule -ServiceType Blob
```
Expand Down
2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/help/Get-AzStorageContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ The **Get-AzStorageContainer** cmdlet lists the storage containers associated wi
## EXAMPLES

### Example 1: Get Azure Storage container by name
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageContainer -Prefix "container"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ The **Get-AzStorageContainerStoredAccessPolicy** cmdlet lists the stored access
## EXAMPLES

### Example 1: Get a stored access policy in a storage container
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageContainerStoredAccessPolicy -Container "Container07"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,23 @@ This cmdlet does not return the contents of the file.
## EXAMPLES

### Example 1: Download a file from a folder
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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.
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageFileContent -ShareName sample -Path "dir1/file1" -Destination $localFilePath -PreserveSMBAttribute
```
Expand Down
3 changes: 3 additions & 0 deletions src/Storage/Storage.Management/help/Get-AzStorageQueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ The **Get-AzStorageQueue** cmdlet lists storage queues associated with an Azure
## EXAMPLES

### Example 1: List all Azure Storage queues
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>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
<!-- Skip: Output cannot be splitted from code -->
```
PS C:\>Get-AzStorageQueue -Prefix "queue"
```
Expand Down
Loading