diff --git a/src/Accounts/Accounts/help/Add-AzEnvironment.md b/src/Accounts/Accounts/help/Add-AzEnvironment.md index 28a77ae285fe..471cac704d34 100644 --- a/src/Accounts/Accounts/help/Add-AzEnvironment.md +++ b/src/Accounts/Accounts/help/Add-AzEnvironment.md @@ -58,6 +58,7 @@ The built-in environments AzureCloud and AzureChinaCloud target existing public ## EXAMPLES ### Example 1: Creating and modifying a new environment + ```powershell Add-AzEnvironment -Name TestEnvironment ` -ActiveDirectoryEndpoint TestADEndpoint ` @@ -107,7 +108,7 @@ ExtendedProperties : {} BatchEndpointResourceId : ``` -In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. +In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. ### Example 2: Discovering a new environment via Uri ```powershell diff --git a/src/Accounts/Accounts/help/Remove-AzEnvironment.md b/src/Accounts/Accounts/help/Remove-AzEnvironment.md index ee73a07aa587..ab91bb2536f4 100644 --- a/src/Accounts/Accounts/help/Remove-AzEnvironment.md +++ b/src/Accounts/Accounts/help/Remove-AzEnvironment.md @@ -23,6 +23,7 @@ The Remove-AzEnvironment cmdlet removes endpoints and metadata information for c ## EXAMPLES ### Example 1: Creating and removing a test environment + ```powershell Add-AzEnvironment -Name TestEnvironment ` -ActiveDirectoryEndpoint TestADEndpoint ` diff --git a/src/Accounts/Accounts/help/Set-AzEnvironment.md b/src/Accounts/Accounts/help/Set-AzEnvironment.md index c5bec52681db..4019cc0a235a 100644 --- a/src/Accounts/Accounts/help/Set-AzEnvironment.md +++ b/src/Accounts/Accounts/help/Set-AzEnvironment.md @@ -51,6 +51,7 @@ The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an in ## EXAMPLES ### Example 1: Creating and modifying a new environment + ```powershell Add-AzEnvironment -Name TestEnvironment ` -ActiveDirectoryEndpoint TestADEndpoint ` diff --git a/src/ApiManagement/ApiManagement/help/Get-AzApiManagementNetworkStatus.md b/src/ApiManagement/ApiManagement/help/Get-AzApiManagementNetworkStatus.md index 45b5b3b9de16..a4b0ea141e77 100644 --- a/src/ApiManagement/ApiManagement/help/Get-AzApiManagementNetworkStatus.md +++ b/src/ApiManagement/ApiManagement/help/Get-AzApiManagementNetworkStatus.md @@ -30,6 +30,7 @@ Gets the Network status of their Api Management service ## EXAMPLES ### Example 1 + ```powershell Get-AzApiManagementNetworkStatus -ResourceGroupName powershelltest -Name powershellsdkservice diff --git a/src/ApiManagement/ApiManagement/help/Restore-AzApiManagement.md b/src/ApiManagement/ApiManagement/help/Restore-AzApiManagement.md index 890017b7c5d8..5da1b77aff19 100644 --- a/src/ApiManagement/ApiManagement/help/Restore-AzApiManagement.md +++ b/src/ApiManagement/ApiManagement/help/Restore-AzApiManagement.md @@ -38,7 +38,6 @@ Restore-AzApiManagement -ResourceGroupName "ContosoGroup" -Name "RestoredContoso This command restores an API Management service from Azure storage blob. ### Example 2: Restore an API Management service using Managed Identity Credentials - ```powershell PS D:> $storageContext=New-AzStorageContext -StorageAccountName apimbackupmsi PS D:> $resourceGroupName="ContosoGroup02"; @@ -46,10 +45,10 @@ PS D:> $apiManagementName="contosoapi"; PS D:> $containerName="apimbackupcontainer"; PS D:> $backupName="test-sdk-backup-1"; PS D:> $msiClientId="a6270d0c-7d86-478b-8cbe-dc9047ba54f7" - PS D:> Restore-AzApiManagement -ResourceGroupName $resourceGroupName -Name $apiManagementName -StorageContext $storageContext -SourceContainerName $containerName -SourceBlobName $backupName -AccessType "UserAssignedManagedIdentity" -IdentityClientId $msiClientId -PassThru +``` - +```output PublicIPAddresses : {52.143.79.150} PrivateIPAddresses : Id : /subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/ContosoGroup02/providers/Microsoft.ApiManagement/service/contosoapi diff --git a/src/ApiManagement/ApiManagement/help/Set-AzApiManagement.md b/src/ApiManagement/ApiManagement/help/Set-AzApiManagement.md index 4658b800ad4e..622d2f83b83b 100644 --- a/src/ApiManagement/ApiManagement/help/Set-AzApiManagement.md +++ b/src/ApiManagement/ApiManagement/help/Set-AzApiManagement.md @@ -72,6 +72,7 @@ Set-AzApiManagement -InputObject $apim -PassThru ``` ### Example 5: Add Managed Certificate to an APIM Service + ```powershell $gateway=New-AzApiManagementCustomHostnameConfiguration -Hostname freecertCanary.contoso.api -HostnameType Proxy -ManagedCertificate diff --git a/src/ApiManagement/ApiManagement/help/Set-AzApiManagementDiagnostic.md b/src/ApiManagement/ApiManagement/help/Set-AzApiManagementDiagnostic.md index debb8a7a8f7f..6af904506e37 100644 --- a/src/ApiManagement/ApiManagement/help/Set-AzApiManagementDiagnostic.md +++ b/src/ApiManagement/ApiManagement/help/Set-AzApiManagementDiagnostic.md @@ -45,6 +45,7 @@ The cmdlet **Set-AzApiManagementDiagnostic** updates the diagnostics which is co ## EXAMPLES ### Example 1: Modify a diagnostic at the Global scope + ```powershell $context =New-AzApiManagementContext -ResourceGroupName Api-Default-WestUS -ServiceName contoso $diagnostic=Get-AzApiManagementDiagnostic -Context $context -DiagnosticId "applicationinsights" diff --git a/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeployment.md b/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeployment.md index 4c80039b6c83..d1a21565625d 100644 --- a/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeployment.md +++ b/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeployment.md @@ -32,6 +32,7 @@ The **Get-AzAutomationDscNodeConfigurationDeployment** cmdlet deploys an APS Des ## EXAMPLES ### Example 1: Get a node configuration deployment + ```powershell $deployment = Get-AzAutomationDscNodeConfigurationDeployment ` -JobId 35b14eb4-52b7-4a1d-ad62-8e9f84adc657 ` diff --git a/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeploymentSchedule.md b/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeploymentSchedule.md index 04f8cbcbfb69..eb3e9714337b 100644 --- a/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeploymentSchedule.md +++ b/src/Automation/Automation/help/Get-AzAutomationDscNodeConfigurationDeploymentSchedule.md @@ -51,6 +51,7 @@ RunbookName : Deploy-NodeConfigurationToAutomationDscNodesV1 ``` ### Example 2: Get a deployment schedule + ```powershell $js = Get-AzAutomationDscNodeConfigurationDeploymentSchedule ` -AutomationAccountName "Contoso01" ` diff --git a/src/Batch/Batch/help/Get-AzBatchAccountKey.md b/src/Batch/Batch/help/Get-AzBatchAccountKey.md index e2ff05e18a1f..caa15f02b7e4 100644 --- a/src/Batch/Batch/help/Get-AzBatchAccountKey.md +++ b/src/Batch/Batch/help/Get-AzBatchAccountKey.md @@ -31,6 +31,7 @@ $Context = Get-AzBatchAccountKey -AccountName myaccount This command gets the account details and stores it in a `$Context` object for use later. ### Example 2: Get batch account keys and display them + ```powershell $Context = Get-AzBatchAccountKey -AccountName myaccount $Context.PrimaryAccountKey diff --git a/src/Batch/Batch/help/Get-AzBatchPoolNodeCount.md b/src/Batch/Batch/help/Get-AzBatchPoolNodeCount.md index df0439048a1e..61c9ff00efb8 100644 --- a/src/Batch/Batch/help/Get-AzBatchPoolNodeCount.md +++ b/src/Batch/Batch/help/Get-AzBatchPoolNodeCount.md @@ -57,6 +57,7 @@ contosopool2 Idle: 1, Rebooting: 1, Total: 2 List node counts per node state for pools under current batch account context. ### Example 2 + ```powershell Get-AzBatchPoolNodeCount -BatchContext $batchContext -PoolId "contosopool1" diff --git a/src/CloudService/help/Get-AzCloudServiceInstanceView.md b/src/CloudService/help/Get-AzCloudServiceInstanceView.md index e13de47c3cc1..d1a551368d74 100644 --- a/src/CloudService/help/Get-AzCloudServiceInstanceView.md +++ b/src/CloudService/help/Get-AzCloudServiceInstanceView.md @@ -23,6 +23,7 @@ Gets the status of a cloud service. ## EXAMPLES ### Example 1: Get cloud service instance view + ```powershell $cloudServiceInstanceView = Get-AzCloudServiceInstanceView -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" diff --git a/src/CloudService/help/New-AzCloudService.md b/src/CloudService/help/New-AzCloudService.md index fa8ebb230bed..e595aace8ddc 100644 --- a/src/CloudService/help/New-AzCloudService.md +++ b/src/CloudService/help/New-AzCloudService.md @@ -134,7 +134,7 @@ $networkProfile = @{loadBalancerConfiguration = $loadBalancerConfig} # Read Configuration File $cscfgFile = "" - = Get-Content $cscfgFile | Out-String +$cscfgContent = Get-Content $cscfgFile | Out-String # Create cloud service $cloudService = New-AzCloudService ` diff --git a/src/Compute/Compute/help/Invoke-AzVMRunCommand.md b/src/Compute/Compute/help/Invoke-AzVMRunCommand.md index 34ca4be71b2d..4cc3bc51de24 100644 --- a/src/Compute/Compute/help/Invoke-AzVMRunCommand.md +++ b/src/Compute/Compute/help/Invoke-AzVMRunCommand.md @@ -46,6 +46,7 @@ Invoke-AzVMRunCommand -ResourceGroupName 'rgname' -VMName 'vmname' -CommandId 'R Invoke a run command 'RunPowerShellScript' with overriding the script 'sample.ps1' on a Windows VM named 'vmname' in resource group 'rgname'. Var1 and var2 are defined as parameters in the sample.ps1. Parameter value can be string type only and script is responsible for converting them to other types if needed. ### Example 2: Invoke a command on Linux + ```powershell export param1=var1 param2=var2 set -- var1 var2 var3 diff --git a/src/Compute/Compute/help/New-AzDiskConfig.md b/src/Compute/Compute/help/New-AzDiskConfig.md index 5f5f4cb65ea8..55489edfe022 100644 --- a/src/Compute/Compute/help/New-AzDiskConfig.md +++ b/src/Compute/Compute/help/New-AzDiskConfig.md @@ -51,6 +51,7 @@ set the disk encryption key and key encryption key settings for the disk object. takes the disk object and creates a disk with name 'Disk01' in resource group 'ResourceGroup01'. ### Example 2 + ```powershell $diskconfig = New-AzDiskConfig -Location 'Central US' -DiskSizeGB 1023 -SkuName Standard_LRS -OsType Windows -CreateOption Upload -DiskIOPSReadWrite 500 -DiskMBpsReadWrite 8; New-AzDisk -ResourceGroupName 'ResourceGroup01' -DiskName 'Disk01' -Disk $diskconfig; diff --git a/src/ConnectedMachine/help/Update-AzConnectedPrivateLinkScopeTag.md b/src/ConnectedMachine/help/Update-AzConnectedPrivateLinkScopeTag.md index 1ac64d79630f..ee2a9d0103ba 100644 --- a/src/ConnectedMachine/help/Update-AzConnectedPrivateLinkScopeTag.md +++ b/src/ConnectedMachine/help/Update-AzConnectedPrivateLinkScopeTag.md @@ -46,6 +46,7 @@ To update other fields use the CreateOrUpdate method. ## EXAMPLES ### Example 1: Update the tags of a private link scope + ```powershell $scope = Update-AzConnectedPrivateLinkScopeTag -ResourceGroupName $resourceGroupName -ScopeName $scopeName -Tag $tags2 diff --git a/src/CosmosDB/CosmosDB/help/Get-AzCosmosDBLocation.md b/src/CosmosDB/CosmosDB/help/Get-AzCosmosDBLocation.md index ecd8226ce879..341d62ceb4db 100644 --- a/src/CosmosDB/CosmosDB/help/Get-AzCosmosDBLocation.md +++ b/src/CosmosDB/CosmosDB/help/Get-AzCosmosDBLocation.md @@ -23,6 +23,7 @@ List Azure Cosmos DB locations with their location properties. It includes Locat ## EXAMPLES ### Example 1: Get Azure Cosmos DB Account Location Properties for Given Location + ```powershell Get-AzCosmosDBLocation -Location "Central US" @@ -49,6 +50,7 @@ Get-AzCosmosDBLocation -Location "Central US" | ConvertTo-Json ``` ### Example 2: List Azure Cosmos DB Account Locations and their properties + ```powershell Get-AzCosmosDBLocation diff --git a/src/DataBox/help/Get-AzDataBoxJobCredential.md b/src/DataBox/help/Get-AzDataBoxJobCredential.md index a700b391134a..e27948bc48c0 100644 --- a/src/DataBox/help/Get-AzDataBoxJobCredential.md +++ b/src/DataBox/help/Get-AzDataBoxJobCredential.md @@ -23,6 +23,7 @@ This method gets the unencrypted secrets related to the job. ## EXAMPLES ### Example 1: Get databoxHeavy job credential + ```powershell Get-AzDataBoxJobCredential -Name "DtbxPowershell" -ResourceGroupName "resourceGroupName" diff --git a/src/DataBox/help/New-AzDataBoxJob.md b/src/DataBox/help/New-AzDataBoxJob.md index 034bdede94e6..469f4c33947f 100644 --- a/src/DataBox/help/New-AzDataBoxJob.md +++ b/src/DataBox/help/New-AzDataBoxJob.md @@ -28,6 +28,7 @@ Existing job cannot be updated with this API and should instead be updated with ## EXAMPLES ### Example 1: Create a databox import job + ```powershell $dataAccount = New-AzDataBoxStorageAccountDetailsObject -DataAccountType "StorageAccount" -StorageAccountId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageAccountName" $contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" diff --git a/src/DataBox/help/Update-AzDataBoxJob.md b/src/DataBox/help/Update-AzDataBoxJob.md index e943bebb58e4..acc9186e0b99 100644 --- a/src/DataBox/help/Update-AzDataBoxJob.md +++ b/src/DataBox/help/Update-AzDataBoxJob.md @@ -25,6 +25,7 @@ Updates the properties of an existing job. ## EXAMPLES ### Example 1: Update databox job encryption from microsoft managed to customer managed with user assigned identities + ```powershell $keyEncryptionDetails = New-AzDataBoxKeyEncryptionKeyObject -KekType "CustomerManaged" -IdentityProperty @{Type = "UserAssigned"; UserAssignedResourceId = "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"} -KekUrl "keyIdentifier" -KekVaultResourceId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/keyVaultName" @@ -55,6 +56,7 @@ Powershell10 WestUS DeviceOrdered ImportToAzure DataBox UserAssigned NonSchedu Update databox job encryption from microsoft managed to customer managed with user assigned identities. ### Example 2: Update databox job encryption from microsoft managed to customer managed with system identities in 2 updates + ```powershell $databoxUpdate = Update-AzDataBoxJob -Name "pwshTestSAssigned" -ResourceGroupName "resourceGroupName" -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -IdentityType "SystemAssigned" diff --git a/src/DataFactory/DataFactoryV2/help/Invoke-AzDataFactoryV2DataFlowDebugSessionCommand.md b/src/DataFactory/DataFactoryV2/help/Invoke-AzDataFactoryV2DataFlowDebugSessionCommand.md index 4f5c8ef76773..3b755b77d837 100644 --- a/src/DataFactory/DataFactoryV2/help/Invoke-AzDataFactoryV2DataFlowDebugSessionCommand.md +++ b/src/DataFactory/DataFactoryV2/help/Invoke-AzDataFactoryV2DataFlowDebugSessionCommand.md @@ -48,6 +48,7 @@ The PowerShell command sequence for data flow debug workflow should be: ## EXAMPLES ### Example 1 + ```powershell $result = Invoke-AzDataFactoryV2DataFlowDebugSessionCommand -ResourceGroupName adf -DataFactoryName WiKiADF -Command executePreviewQuery -SessionId fd76cd0d-8b37-4dc0-a370-3f9d43ac686d -StreamName source1 -RowLimit 100 -AsJob $result diff --git a/src/DataFactory/DataFactoryV2/help/Start-AzDataFactoryV2DataFlowDebugSession.md b/src/DataFactory/DataFactoryV2/help/Start-AzDataFactoryV2DataFlowDebugSession.md index 12af94246877..1e4c905f69da 100644 --- a/src/DataFactory/DataFactoryV2/help/Start-AzDataFactoryV2DataFlowDebugSession.md +++ b/src/DataFactory/DataFactoryV2/help/Start-AzDataFactoryV2DataFlowDebugSession.md @@ -43,6 +43,7 @@ The PowerShell command sequence for data flow debug workflow should be: ## EXAMPLES ### Example 1 + ```powershell $job = Start-AzDataFactoryV2DataFlowDebugSession -ResourceGroupName adf -DataFactoryName jikma0601sea -AsJob $job diff --git a/src/DataMigration/DataMigration/help/New-AzDataMigrationMongoDbCollectionSetting.md b/src/DataMigration/DataMigration/help/New-AzDataMigrationMongoDbCollectionSetting.md index 835be72df0d5..cb1da48cccbd 100644 --- a/src/DataMigration/DataMigration/help/New-AzDataMigrationMongoDbCollectionSetting.md +++ b/src/DataMigration/DataMigration/help/New-AzDataMigrationMongoDbCollectionSetting.md @@ -26,6 +26,7 @@ the database level settings for migration. ## EXAMPLES ### Example 1 + ```powershell $x = New-AzDataMigrationMongoDbCollectionSetting -Name myCollection -TargetRequestUnit 1000 -CanDelete -ShardKey "_id:-1,age:1,name" $x diff --git a/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineActionObject.md b/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineActionObject.md index 66c0275efde4..9322f31e7e0d 100644 --- a/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineActionObject.md +++ b/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineActionObject.md @@ -49,6 +49,7 @@ Use cmdlet "New-AzFrontDoorHeaderActionObject" to create PSHeaderObjects to pass ## EXAMPLES ### Example 1 + ```powershell $headerActions = New-AzFrontDoorHeaderActionObject -HeaderActionType "Append" -HeaderName "X-Content-Type-Options" -Value "nosniff" $headerActions @@ -69,6 +70,7 @@ RequestHeaderActions ResponseHeaderActions RouteConfigurationOverride Create a rules engine action that append response header value and show how to view the properties of the rules engine action created. ### Example 2 + ```powershell $rulesEngineAction = New-AzFrontDoorRulesEngineActionObject -RequestHeaderAction $headerActions -ForwardingProtocol HttpsOnly -BackendPoolName mybackendpool -ResourceGroupName Jessicl-Test-RG -FrontDoorName jessicl-test-myappfrontend -QueryParameterStripDirective StripNone -DynamicCompression Disabled -EnableCaching $true $rulesEngineAction @@ -99,6 +101,7 @@ EnableCaching : True Create a rules engine action that forwards the requests to a speicific backend pool and show how to view the properties of the rules engine action created. ### Example 3 + ```powershell $rulesEngineAction = New-AzFrontDoorRulesEngineActionObject -RedirectType Moved -RedirectProtocol MatchRequest -CustomHost www.contoso.com $rulesEngineAction diff --git a/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineRuleObject.md b/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineRuleObject.md index 28052297463f..2a0a5d5d370c 100644 --- a/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineRuleObject.md +++ b/src/FrontDoor/FrontDoor/help/New-AzFrontDoorRulesEngineRuleObject.md @@ -27,6 +27,7 @@ Use cmdlet "New-AzFrontDoorRulesEngineMatchConditionObject" to create PSRulesEng ## EXAMPLES ### Example 1 + ```powershell New-AzFrontDoorRulesEngineRuleObject -Name rules1 -Priority 0 -Action $rulesEngineAction -MatchProcessingBehavior Stop -MatchCondition $rulesEngineMatchCondition diff --git a/src/FrontDoor/FrontDoor/help/Set-AzFrontDoorRulesEngine.md b/src/FrontDoor/FrontDoor/help/Set-AzFrontDoorRulesEngine.md index 65d34ab09cf1..f23e81fc2b6f 100644 --- a/src/FrontDoor/FrontDoor/help/Set-AzFrontDoorRulesEngine.md +++ b/src/FrontDoor/FrontDoor/help/Set-AzFrontDoorRulesEngine.md @@ -37,6 +37,7 @@ Update a Rules Engine. ## EXAMPLES ### Example 1 + ```powershell Get-AzFrontDoorRulesEngine -ResourceGroupName $resourceGroupName -FrontDoorName $frontDoorName -Name myRulesEngine diff --git a/src/KeyVault/KeyVault/help/Add-AzKeyVaultCertificate.md b/src/KeyVault/KeyVault/help/Add-AzKeyVaultCertificate.md index 0b3a2bcccd95..879d69b1dac6 100644 --- a/src/KeyVault/KeyVault/help/Add-AzKeyVaultCertificate.md +++ b/src/KeyVault/KeyVault/help/Add-AzKeyVaultCertificate.md @@ -25,6 +25,7 @@ The **Add-AzKeyVaultCertificate** cmdlet starts the process of enrolling for a c ## EXAMPLES ### Example 1: Add a certificate + ```powershell $Policy = New-AzKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal Add-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01" -CertificatePolicy $Policy diff --git a/src/KeyVault/KeyVault/help/Get-AzKeyVaultRoleDefinition.md b/src/KeyVault/KeyVault/help/Get-AzKeyVaultRoleDefinition.md index e0ca1150a4bc..2f58538bd36f 100644 --- a/src/KeyVault/KeyVault/help/Get-AzKeyVaultRoleDefinition.md +++ b/src/KeyVault/KeyVault/help/Get-AzKeyVaultRoleDefinition.md @@ -55,6 +55,7 @@ Managed HSM Backup 1 permission(s) The example lists all the roles at "/keys" scope. ### Example 2 + ```powershell $backupRole = Get-AzKeyVaultRoleDefinition -HsmName myHsm -RoleDefinitionName "Managed HSM Backup User" diff --git a/src/KeyVault/KeyVault/help/Set-AzKeyVaultAccessPolicy.md b/src/KeyVault/KeyVault/help/Set-AzKeyVaultAccessPolicy.md index 458084230ed6..be0c21f091e0 100644 --- a/src/KeyVault/KeyVault/help/Set-AzKeyVaultAccessPolicy.md +++ b/src/KeyVault/KeyVault/help/Set-AzKeyVaultAccessPolicy.md @@ -164,6 +164,7 @@ The cmdlet may call below Microsoft Graph API according to input parameters: ## EXAMPLES ### Example 1: Grant permissions to a user for a key vault and modify the permissions + ```powershell Set-AzKeyVaultAccessPolicy -VaultName 'Contoso03Vault' -UserPrincipalName 'PattiFuller@contoso.com' -PermissionsToKeys create,import,delete,list -PermissionsToSecrets set,delete -PassThru diff --git a/src/LogicApp/LogicApp/help/Remove-AzIntegrationAccountReceivedIcn.md b/src/LogicApp/LogicApp/help/Remove-AzIntegrationAccountReceivedIcn.md index 4fb0cbf715bf..175d992761d1 100644 --- a/src/LogicApp/LogicApp/help/Remove-AzIntegrationAccountReceivedIcn.md +++ b/src/LogicApp/LogicApp/help/Remove-AzIntegrationAccountReceivedIcn.md @@ -27,6 +27,7 @@ Please do provide the "-AgreementType" parameter to specify whether X12 or Edifa ## EXAMPLES ### Example 1 + ```powershell Get-AzIntegrationAccountReceivedIcn -AgreementType "X12" -ResourceGroupName "groupName" -Name "accountName" -AgreementName "X12AgreementName" -ControlNumberValue "000000641" @@ -53,6 +54,7 @@ Removes the received X12 interchange control number. Confirms the received X12 interchange control number was removed by attempting to get it again. ### Example 2 + ```powershell Get-AzIntegrationAccountReceivedIcn -AgreementType "Edifact" -ResourceGroupName "groupName" -Name "accountName" -AgreementName "EdifactAgreementName" -ControlNumberValue "000000641" diff --git a/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md b/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md index e927654fdec9..51afcbb1ccad 100644 --- a/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md @@ -37,6 +37,7 @@ for ## EXAMPLES ### Example 1 + ```powershell $metric = New-AzDiagnosticDetailSetting -Metric -RetentionInDays 1 -RetentionEnabled -Category AllMetrics $log = New-AzDiagnosticDetailSetting -Log -RetentionInDays 1 -RetentionEnabled -Category Audit -Enabled diff --git a/src/Network/Network/help/Get-AzNatGateway.md b/src/Network/Network/help/Get-AzNatGateway.md index 6ed91b61cb4a..23d0aa1c6b64 100644 --- a/src/Network/Network/help/Get-AzNatGateway.md +++ b/src/Network/Network/help/Get-AzNatGateway.md @@ -34,6 +34,7 @@ Gets a Nat Gateway resource in a resource group by name OR NatGateway Id OR all ## EXAMPLES ### Example 1 + ```powershell Get-AzNatGateway -ResourceGroupName "natgateway_test" diff --git a/src/Network/Network/help/Get-AzNetworkServiceTag.md b/src/Network/Network/help/Get-AzNetworkServiceTag.md index c8dedddd27b5..b4d363f2e7f3 100644 --- a/src/Network/Network/help/Get-AzNetworkServiceTag.md +++ b/src/Network/Network/help/Get-AzNetworkServiceTag.md @@ -25,6 +25,7 @@ For example, even if you specify `-Location eastus2` you will get the list of se ## EXAMPLES ### Example 1 + ```powershell $serviceTags = Get-AzNetworkServiceTag -Location eastus2 $serviceTags @@ -73,6 +74,7 @@ Change Number : 2 The command gets the list of service tag information resources and stores it in variable `serviceTags`. ### Example 2: Get all address prefixes for AzureSQL + ```powershell $serviceTags = Get-AzNetworkServiceTag -Location eastus2 $sql = $serviceTags.Values | Where-Object { $_.Name -eq "Sql" } @@ -98,6 +100,7 @@ The first command gets the list of service tag information resources and stores The second command filters the list to select information resource for Sql. ### Example 3: Get Storage's service tag information resource for West US 2 + ```powershell $serviceTags = Get-AzNetworkServiceTag -Location eastus2 $serviceTags.Values | Where-Object { $_.Name -eq "Storage.WestUS2" } diff --git a/src/Network/Network/help/Get-AzP2sVpnGatewayDetailedConnectionHealth.md b/src/Network/Network/help/Get-AzP2sVpnGatewayDetailedConnectionHealth.md index 4fbe5d85f281..c18882d20732 100644 --- a/src/Network/Network/help/Get-AzP2sVpnGatewayDetailedConnectionHealth.md +++ b/src/Network/Network/help/Get-AzP2sVpnGatewayDetailedConnectionHealth.md @@ -39,6 +39,7 @@ Please note that the SAS url provided should be one for the **blob** (file) that ## EXAMPLES ### Example 1 + ```powershell $blobSasUrl = New-AzStorageBlobSASToken -Container contp2stesting -Blob emptyfile.txt -Context $context -Permission "rwd" -StartTime $now.AddHours(-1) -ExpiryTime $now.AddDays(1) -FullUri $blobSasUrl diff --git a/src/Network/Network/help/New-AzApplicationGatewayRewriteRuleCondition.md b/src/Network/Network/help/New-AzApplicationGatewayRewriteRuleCondition.md index 32bc9a385bcc..9d62cebaf5b1 100644 --- a/src/Network/Network/help/New-AzApplicationGatewayRewriteRuleCondition.md +++ b/src/Network/Network/help/New-AzApplicationGatewayRewriteRuleCondition.md @@ -23,6 +23,7 @@ New-AzApplicationGatewayRewriteRuleCondition -Variable [-Pattern ```powershell $condition = New-AzApplicationGatewayRewriteRuleCondition -Variable "var_request_uri" -Pattern "http" -IgnoreCase $condition diff --git a/src/Network/Network/help/New-AzVHubRoute.md b/src/Network/Network/help/New-AzVHubRoute.md index 213305c1601e..1a8eeb8cb529 100644 --- a/src/Network/Network/help/New-AzVHubRoute.md +++ b/src/Network/Network/help/New-AzVHubRoute.md @@ -63,6 +63,7 @@ The above command will create a VHubRoute object with nextHop as the specified h ### Example 3 + ```powershell $hub = Get-AzVirtualHub -ResourceGroupName "rgname" -Name "virtual-hub-name" $hubVnetConn = Get-AzVirtualHubVnetConnection -ParentObject $hub -Name "connection-name" @@ -238,4 +239,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Remove-AzVHubRouteTable](./Remove-AzVHubRouteTable.md) -[Update-AzVHubRouteTable](./Update-AzVHubRouteTable.md) \ No newline at end of file +[Update-AzVHubRouteTable](./Update-AzVHubRouteTable.md) diff --git a/src/Network/Network/help/New-AzVirtualHubVnetConnection.md b/src/Network/Network/help/New-AzVirtualHubVnetConnection.md index 1fc4b893b131..0bd3795941da 100644 --- a/src/Network/Network/help/New-AzVirtualHubVnetConnection.md +++ b/src/Network/Network/help/New-AzVirtualHubVnetConnection.md @@ -114,6 +114,7 @@ New-AzVirtualHubVnetConnection -EnableInternetSecurity -Name 'testvnetconnection ### Example 3 + ```powershell $rgName = "testRg" $virtualHubName = "testHub" diff --git a/src/Network/Network/help/Remove-AzDdosProtectionPlan.md b/src/Network/Network/help/Remove-AzDdosProtectionPlan.md index 2d46bb4eeda0..20c6319f3b8e 100644 --- a/src/Network/Network/help/Remove-AzDdosProtectionPlan.md +++ b/src/Network/Network/help/Remove-AzDdosProtectionPlan.md @@ -30,6 +30,7 @@ Remove-AzDdosProtectionPlan -ResourceGroupName ResourceGroupName -Name DdosProte In this case, we remove a DDoS protection plan as specified. ### Example 2: Remove a DDoS protection plan associated with a virtual network + ```powershell $vnet = Get-AzVirtualNetwork -Name VnetName -ResourceGroupName ResourceGroupName $vnet.DdosProtectionPlan = $null @@ -196,4 +197,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Set-AzVirtualNetwork](./Set-AzVirtualNetwork.md) -[Get-AzVirtualNetwork](./Get-AzVirtualNetwork.md) \ No newline at end of file +[Get-AzVirtualNetwork](./Get-AzVirtualNetwork.md) diff --git a/src/Network/Network/help/Set-AzBastion.md b/src/Network/Network/help/Set-AzBastion.md index 94b105453e83..c26e9fe26958 100644 --- a/src/Network/Network/help/Set-AzBastion.md +++ b/src/Network/Network/help/Set-AzBastion.md @@ -63,6 +63,7 @@ Scale Units : 10 Updates BastionHost resource with Basic Sku and 2 Scale Units to Standard Sku and 10 Scale Units ### Example 2 + ```powershell $bastionObj = Get-AzBastion -ResourceGroupName "MyRg" -Name "MyBastion" $bastionObj @@ -300,4 +301,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Get-AzBastion](./Get-AzBastion.md) -[Remove-AzBastion](./Remove-AzBastion.md) \ No newline at end of file +[Remove-AzBastion](./Remove-AzBastion.md) diff --git a/src/Network/Network/help/Set-AzPrivateDnsZoneGroup.md b/src/Network/Network/help/Set-AzPrivateDnsZoneGroup.md index 34dac8cc0530..1294b063bfe8 100644 --- a/src/Network/Network/help/Set-AzPrivateDnsZoneGroup.md +++ b/src/Network/Network/help/Set-AzPrivateDnsZoneGroup.md @@ -24,6 +24,7 @@ The **Set-AzPrivateDnsZoneGroup** cmdlet updates DNS zone group. ## EXAMPLES ### Example 1 + ```powershell Get-AzPrivateDnsZoneGroup -ResourceGroupName rg -PrivateEndpointName my-pr-endpoint -name dnsgroup1 diff --git a/src/Network/Network/help/Set-AzRouteTable.md b/src/Network/Network/help/Set-AzRouteTable.md index bc7642db8b3e..ded92cc5b893 100644 --- a/src/Network/Network/help/Set-AzRouteTable.md +++ b/src/Network/Network/help/Set-AzRouteTable.md @@ -76,6 +76,7 @@ The command passes that table to the Add-AzRouteConfig cmdlet by using the pipel **Add-AzRouteConfig** adds the route named Route07, and then passes the result to the current cmdlet, which updates the table to reflect your changes. ### Example 2: Modify route table + ```powershell $rt = Get-AzRouteTable -ResourceGroupName "rgName" -Name "rtName" diff --git a/src/Network/Network/help/Set-AzVirtualNetworkGateway.md b/src/Network/Network/help/Set-AzVirtualNetworkGateway.md index 76e5412af4a6..1ae22cadd241 100644 --- a/src/Network/Network/help/Set-AzVirtualNetworkGateway.md +++ b/src/Network/Network/help/Set-AzVirtualNetworkGateway.md @@ -130,6 +130,7 @@ The first command gets a virtual network gateway named Gateway01 that belongs to The second command updates the virtual network gateway Gateway01 with the tags @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }. ### Example 4: Add/Update AAD authentication configuration for VpnClient of an existing virtual network gateway + ```powershell $Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001" Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -AadTenantUri "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuerUri "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudienceId "a21fce82-76af-45e6-8583-a08cb3b956f9" diff --git a/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordConfig.md b/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordConfig.md index b3cb895ccf25..f2143b3927eb 100644 --- a/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordConfig.md +++ b/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordConfig.md @@ -57,6 +57,7 @@ The New-AzPrivateDnsRecordConfig cmdlet creates a local PSPrivateDnsRecord objec ## EXAMPLES ### Example 1: Create a RecordSet of type A + ```powershell $Records = @() $Records += New-AzPrivateDnsRecordConfig -IPv4Address 1.2.3.4 diff --git a/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordSet.md b/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordSet.md index 7ba4a5e2abd2..06b5143a02a9 100644 --- a/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordSet.md +++ b/src/PrivateDns/PrivateDns/help/New-AzPrivateDnsRecordSet.md @@ -39,6 +39,7 @@ The New-AzPrivateDnsRecordSet cmdlet creates a new Private Domain Name System (D ## EXAMPLES ### Example 1: Create a RecordSet of type A + ```powershell $Records = @() $Records += New-AzPrivateDnsRecordConfig -IPv4Address 1.2.3.4 diff --git a/src/RecoveryServices/RecoveryServices/help/Disable-AzRecoveryServicesBackupRPMountScript.md b/src/RecoveryServices/RecoveryServices/help/Disable-AzRecoveryServicesBackupRPMountScript.md index 5abe526efdd9..37e07ae86204 100644 --- a/src/RecoveryServices/RecoveryServices/help/Disable-AzRecoveryServicesBackupRPMountScript.md +++ b/src/RecoveryServices/RecoveryServices/help/Disable-AzRecoveryServicesBackupRPMountScript.md @@ -23,6 +23,7 @@ The Disable-AzRecoveryServicesBackupRPMountScript cmdlet dismounts the files of ## EXAMPLES ### Example 1: Dismount a recovery point + ```powershell $namedContainer = Get-AzRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "V2VM" $backupitem = Get-AzRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM" diff --git a/src/ResourceMover/help/Invoke-AzResourceMoverPrepare.md b/src/ResourceMover/help/Invoke-AzResourceMoverPrepare.md index 2cee5a63b7a7..af7267b5a615 100644 --- a/src/ResourceMover/help/Invoke-AzResourceMoverPrepare.md +++ b/src/ResourceMover/help/Invoke-AzResourceMoverPrepare.md @@ -28,6 +28,7 @@ To aid the user to prerequisite the operation the client can call operation with ## EXAMPLES ### Example 1: Validate the dependecies before prepare of the resources. Get the required dependent resources that also need to be prepared. + ```powershell $resp = Invoke-AzResourceMoverPrepare -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -MoveResource $('psdemovm') -ValidateOnly diff --git a/src/Resources/Resources/help/Get-AzManagementGroup.md b/src/Resources/Resources/help/Get-AzManagementGroup.md index 449836ae0436..c8b781583da3 100644 --- a/src/Resources/Resources/help/Get-AzManagementGroup.md +++ b/src/Resources/Resources/help/Get-AzManagementGroup.md @@ -66,6 +66,7 @@ ParentDisplayName : TestGroupParent ``` ### Example 3: Get specific Management Group and first level of hierarchy + ```powershell $reponse = Get-AzManagementGroup -GroupName TestGroupParent -Expand $response @@ -94,6 +95,7 @@ Children : With the `Expand` flag, one can navigate through the `Children` array and get details for each child. For example, `Children[0]` will give details for the group with display name `TestGroup1DisplayName`. ### Example 4: Get specific Management Group and all levels of hierarchy + ```powershell $response = Get-AzManagementGroup -GroupName TestGroupParent -Expand -Recurse $response diff --git a/src/Resources/Resources/help/New-AzRoleAssignment.md b/src/Resources/Resources/help/New-AzRoleAssignment.md index 9966b7b71d28..8263c1769915 100644 --- a/src/Resources/Resources/help/New-AzRoleAssignment.md +++ b/src/Resources/Resources/help/New-AzRoleAssignment.md @@ -131,6 +131,7 @@ New-AzRoleAssignment -ResourceGroupName rg1 -SignInName allen.young@live.com -Ro Grant Reader role access to a user at a resource group scope with the Role Assignment being available for delegation ### Example 2 + ```powershell Get-AzADGroup -SearchString "Christine Koch Team" diff --git a/src/Resources/Resources/help/New-AzTag.md b/src/Resources/Resources/help/New-AzTag.md index 87ab6afecffe..078a738cdebc 100644 --- a/src/Resources/Resources/help/New-AzTag.md +++ b/src/Resources/Resources/help/New-AzTag.md @@ -82,6 +82,7 @@ Values: This command creates a predefined tag named Department with a value of Finance. ### Example 3: Add a value to a predefined tag + ```powershell New-AzTag -Name "Department" -Value "Finance" @@ -105,6 +106,7 @@ These commands create a predefined tag named Department with two values. If the tag name exists, **New-AzTag** adds the value to the existing tag instead of creating a new one. ### Example 4: Use a predefined tag + ```powershell New-AzTag -Name "CostCenter" -Value "0001" @@ -333,4 +335,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Remove-AzTag](./Remove-AzTag.md) -[Update-AzTag](./Update-AzTag.md) \ No newline at end of file +[Update-AzTag](./Update-AzTag.md) diff --git a/src/Resources/Resources/help/Set-AzPolicyAssignment.md b/src/Resources/Resources/help/Set-AzPolicyAssignment.md index a58edd32c564..b7aa14cf4849 100644 --- a/src/Resources/Resources/help/Set-AzPolicyAssignment.md +++ b/src/Resources/Resources/help/Set-AzPolicyAssignment.md @@ -133,6 +133,7 @@ The command stores that object in the $PolicyAssignment variable. The final command updates the parameter values on the policy assignment named PolicyAssignment. ### Example 5: Update policy assignment parameters with policy parameter file + Create a file called _AllowedLocations.json_ in the local working directory with the following content. ``` diff --git a/src/Resources/Resources/help/Stop-AzResourceGroupDeployment.md b/src/Resources/Resources/help/Stop-AzResourceGroupDeployment.md index 2607154a915c..819ba50ab993 100644 --- a/src/Resources/Resources/help/Stop-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/Stop-AzResourceGroupDeployment.md @@ -40,6 +40,7 @@ If the cmdlet finds more than one running deployment, the command fails. ## EXAMPLES ### Example 1: Starting and stopping a resource group deployment + ```powershell New-AzResourceGroupDeployment -Name mynewstorageaccount -ResourceGroupName myrg -TemplateFile .\storage-account-create-azdeploy.json -TemplateParameterFile .\storage-account-create-azdeploy.parameters.json -AsJob diff --git a/src/Search/Search/help/Remove-AzSearchQueryKey.md b/src/Search/Search/help/Remove-AzSearchQueryKey.md index 24c97ddd4179..d78182942291 100644 --- a/src/Search/Search/help/Remove-AzSearchQueryKey.md +++ b/src/Search/Search/help/Remove-AzSearchQueryKey.md @@ -36,6 +36,7 @@ The **Remove-AzSearchQueryKey** cmdlet removes the query key from the Azure Cogn ## EXAMPLES ### Example 1 + ```powershell Get-AzSearchQueryKey -ResourceGroupName "TestAzureSearchPsGroup" -ServiceName "pstestazuresearch01" diff --git a/src/SignalR/SignalR/help/New-AzWebPubSub.md b/src/SignalR/SignalR/help/New-AzWebPubSub.md index 1cbdd715eee8..f44b490984f2 100644 --- a/src/SignalR/SignalR/help/New-AzWebPubSub.md +++ b/src/SignalR/SignalR/help/New-AzWebPubSub.md @@ -43,6 +43,7 @@ psdemo-wps eastus Standard_S1 ### Example 2: Create a Web PubSub resource with more parameters and show the result + ```powershell $wps = New-AzWebPubSub -ResourceGroupName psdemo -Name psdemo-wps ` -Location eastus -SkuName Standard_S1 -IdentityType SystemAssigned -LiveTraceEnabled true ` diff --git a/src/SignalR/SignalR/help/Update-AzSignalRNetworkAcl.md b/src/SignalR/SignalR/help/Update-AzSignalRNetworkAcl.md index ee91bc842e80..0af6d66cc982 100644 --- a/src/SignalR/SignalR/help/Update-AzSignalRNetworkAcl.md +++ b/src/SignalR/SignalR/help/Update-AzSignalRNetworkAcl.md @@ -39,6 +39,7 @@ Update the Network ACL of a SignalR service, including the default action and th ## EXAMPLES ### Allow RESTAPI,ClientConnection for public network and set default action to Deny + ```powershell $networkAcl = Update-AzSignalRNetworkAcl -Name pssignalr -ResourceGroupName test_resource_group -DefaultAction Deny -PublicNetwork -Allow RESTAPI,ClientConnection diff --git a/src/SignalR/SignalR/help/Update-AzWebPubSub.md b/src/SignalR/SignalR/help/Update-AzWebPubSub.md index f2e3480007d3..cacf014ebd1d 100644 --- a/src/SignalR/SignalR/help/Update-AzWebPubSub.md +++ b/src/SignalR/SignalR/help/Update-AzWebPubSub.md @@ -43,6 +43,7 @@ Operation to update an exiting resource. ## EXAMPLES ### Example 1: Update a Web PubSub resource + ```powershell $wps = Update-AzWebPubSub -ResourceGroupName psdemo -Name psdemo-wps ` -IdentityType SystemAssigned -LiveTraceEnabled true ` diff --git a/src/Sql/Sql/help/Convert-AzSqlDatabaseVulnerabilityAssessmentScan.md b/src/Sql/Sql/help/Convert-AzSqlDatabaseVulnerabilityAssessmentScan.md index 53d1b8e8f6da..721e8b655c2d 100644 --- a/src/Sql/Sql/help/Convert-AzSqlDatabaseVulnerabilityAssessmentScan.md +++ b/src/Sql/Sql/help/Convert-AzSqlDatabaseVulnerabilityAssessmentScan.md @@ -25,6 +25,7 @@ Note that you need to run *Enable-AzSqlServerAdvancedDataSecurity* and *Update-A ## EXAMPLES ### Example 1: Converts vulnerability assessment scan results and saves them to local disk + ```powershell Update-AzSqlServerVulnerabilityAssessmentSetting ` -ResourceGroupName "ResourceGroup01" ` diff --git a/src/Sql/Sql/help/Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan.md b/src/Sql/Sql/help/Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan.md index 93fb172d29e3..b43f11b7f899 100644 --- a/src/Sql/Sql/help/Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan.md +++ b/src/Sql/Sql/help/Convert-AzSqlInstanceDatabaseVulnerabilityAssessmentScan.md @@ -33,6 +33,7 @@ Note that you need to run *Enable-AzSqlInstanceAdvancedDataSecurity* and *Update ## EXAMPLES ### Example 1 - Converts vulnerability assessment scan results and saves them to local disk + ```powershell Update-AzSqlInstanceVulnerabilityAssessmentSetting ` -ResourceGroupName "ResourceGroup01" ` diff --git a/src/Sql/Sql/help/Get-AzSqlInstance.md b/src/Sql/Sql/help/Get-AzSqlInstance.md index afa40a527267..a120130e3094 100644 --- a/src/Sql/Sql/help/Get-AzSqlInstance.md +++ b/src/Sql/Sql/help/Get-AzSqlInstance.md @@ -323,6 +323,7 @@ ZoneRedundant : false This command gets information about the instance named managedInstance1. ### Example 8: Get all instances assigned to a resource group with external administrator information + ```powershell $val = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -ExpandActiveDirectoryAdministrator @@ -380,6 +381,7 @@ AzureADOnlyAuthentication : True This command gets information about all instances assigned to the resource group ResourceGroup01. . ### Example 9: Get information about an instance with external administrator information + ```powershell $val = Get-AzSqlInstance -Name "managedInstance1" -ResourceGroupName "ResourceGroup01" -ExpandActiveDirectoryAdministrator diff --git a/src/Sql/Sql/help/Get-AzSqlServer.md b/src/Sql/Sql/help/Get-AzSqlServer.md index 70e2da63cc00..abf0e579be5e 100644 --- a/src/Sql/Sql/help/Get-AzSqlServer.md +++ b/src/Sql/Sql/help/Get-AzSqlServer.md @@ -141,6 +141,7 @@ FullyQualifiedDomainName : server02.database.windows.net This command gets information about all the Azure SQL Database servers assigned to the resource group ResourceGroup01 that start with "server". ### Example 5: Get all instances of SQL Server assigned to a resource group with external administrator information + ```powershell $val = Get-AzSqlServer -ResourceGroupName "ResourceGroup01" -ExpandActiveDirectoryAdministrator @@ -185,6 +186,7 @@ AzureADOnlyAuthentication : True This command gets information about all the Azure SQL Database servers assigned to the resource group ResourceGroup01. ### Example 6: Get information about an Azure SQL Database server with external administrator information + ```powershell $val = Get-AzSqlServer -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -ExpandActiveDirectoryAdministrator ResourceGroupName : resourcegroup01 diff --git a/src/Sql/Sql/help/Get-AzSqlServerOutboundFirewallRule.md b/src/Sql/Sql/help/Get-AzSqlServerOutboundFirewallRule.md index d76b22f0127f..e101e1e12858 100644 --- a/src/Sql/Sql/help/Get-AzSqlServerOutboundFirewallRule.md +++ b/src/Sql/Sql/help/Get-AzSqlServerOutboundFirewallRule.md @@ -25,6 +25,7 @@ If you specify the name of an allowed FQDN, this cmdlet gets information about t ## EXAMPLES ### Example 1: Get outbound firewall rule(s) for a server + ```powershell Get-AzSqlServerOutboundFirewallRule -ServerName "Server01" -ResourceGroupName "ResourceGroup01" -AllowedFQDN "OutboundFirewallRule01" diff --git a/src/Sql/Sql/help/New-AzSqlInstance.md b/src/Sql/Sql/help/New-AzSqlInstance.md index 3dae7060baa5..3a388d749b45 100644 --- a/src/Sql/Sql/help/New-AzSqlInstance.md +++ b/src/Sql/Sql/help/New-AzSqlInstance.md @@ -239,6 +239,7 @@ MaintenanceConfigurationId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx This command creates a new instance with maintenance configuration MI_2 ### Example 7: Create a new instance with External(Azure Active Directory) Administrator, Azure Active Directory Only Authentication and no SqlAdministratorCredentials + ```powershell New-AzSqlInstance -Name managedInstance2 -ResourceGroupName ResourceGroup01 -ExternalAdminName DummyLogin -EnableActiveDirectoryOnlyAuthentication -Location westcentralus -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Network/virtualNetworks/vnet_name/subnets/subnet_name" -LicenseType LicenseIncluded -StorageSizeInGB 1024 -VCore 16 -Edition "GeneralPurpose" -ComputeGeneration Gen4 diff --git a/src/Sql/Sql/help/New-AzSqlServer.md b/src/Sql/Sql/help/New-AzSqlServer.md index aedd026eaab6..cbfeab4fc962 100644 --- a/src/Sql/Sql/help/New-AzSqlServer.md +++ b/src/Sql/Sql/help/New-AzSqlServer.md @@ -47,6 +47,7 @@ Tags : This command creates a version 12 Azure SQL Database server. ### Example 2: Create a new Azure SQL Database server with External(Azure Active Directory) Administrator, Azure Active Directory Only Authentication and no SqlAdministratorCredentials + ```powershell New-AzSqlServer -ResourceGroupName "ResourceGroup01" -Location "Central US" -ServerName "server01" -ServerVersion "12.0" -ExternalAdminName DummyLogin -EnableActiveDirectoryOnlyAuthentication ResourceGroupName : resourcegroup01 diff --git a/src/Sql/Sql/help/Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline.md b/src/Sql/Sql/help/Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline.md index 9121027b1494..5414f9a15b0d 100644 --- a/src/Sql/Sql/help/Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline.md +++ b/src/Sql/Sql/help/Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline.md @@ -27,6 +27,7 @@ Note that you need to run *Enable-AzSqlServerAdvancedDataSecurity* and *Update-A ## EXAMPLES ### Example 1: Set a vulnerability assessment rule baseline + ```powershell Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline ` -ResourceGroupName "ahmadtesting" ` diff --git a/src/Sql/Sql/help/Set-AzSqlInstanceDatabase.md b/src/Sql/Sql/help/Set-AzSqlInstanceDatabase.md index daaa468e5370..b21724593581 100644 --- a/src/Sql/Sql/help/Set-AzSqlInstanceDatabase.md +++ b/src/Sql/Sql/help/Set-AzSqlInstanceDatabase.md @@ -44,6 +44,7 @@ Set-AzSqlInstanceDatabase [-Tag ] [-ResourceId] [-AsJob] ## EXAMPLES ### Example 1 + ```powershell PS C:\> Set-AzSqlInstanceDatabase -Name "name1" -InstanceName "instance1" -ResourceGroupName "rg1" -Tags @{tag1="value1"} diff --git a/src/Storage/Storage.Management/help/Add-AzStorageAccountManagementPolicyAction.md b/src/Storage/Storage.Management/help/Add-AzStorageAccountManagementPolicyAction.md index 82d8d6285811..8b9036b6461d 100644 --- a/src/Storage/Storage.Management/help/Add-AzStorageAccountManagementPolicyAction.md +++ b/src/Storage/Storage.Management/help/Add-AzStorageAccountManagementPolicyAction.md @@ -52,6 +52,7 @@ The **Add-AzStorageAccountManagementPolicyAction** cmdlet adds an action to the ## EXAMPLES ### Example 1: Creates a ManagementPolicy Action Group object with 4 actions, then add it to a management policy rule and set to a Storage account + ``` PS C:\>$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -DaysAfterCreationGreaterThan 100 PS C:\>$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -DaysAfterLastTierChangeGreaterThan 40 -InputObject $action @@ -87,6 +88,7 @@ PS C:\>$policy = Set-AzStorageAccountManagementPolicy -ResourceGroupName "myreso The first command create a ManagementPolicy Action Group object, the following 3 commands add 3 actions to the object. Then add it to a management policy rule and set to a Storage account. ### Example 2: Creates a ManagementPolicy Action Group object with 6 actions on snapshot and blob version, then add it to a management policy rule and set to a Storage account + ``` PS C:\> $action = Add-AzStorageAccountManagementPolicyAction -SnapshotAction Delete -daysAfterCreationGreaterThan 40 PS C:\> $action = Add-AzStorageAccountManagementPolicyAction -InputObject $action -SnapshotAction TierToArchive -daysAfterCreationGreaterThan 50 diff --git a/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md b/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md index 51442268f49f..2fbb47e0300b 100644 --- a/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md +++ b/src/Storage/Storage.Management/help/Close-AzStorageFileHandle.md @@ -80,6 +80,7 @@ PS C:\> Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recu 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 + ``` PS C:\> Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -CloseAll -PassThru 10 diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md index efc68e8132b6..600ed5982fbd 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageBlobDeleteRetentionPolicy.md @@ -36,6 +36,7 @@ The **Disable-AzStorageBlobDeleteRetentionPolicy** cmdlet disables delete retent ## EXAMPLES ### Example 1: Disable delete retention policy for the Blob service + ``` C:\PS>Disable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru diff --git a/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md index 715a6a5b51b6..7ad047b45cb0 100644 --- a/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Disable-AzStorageContainerDeleteRetentionPolicy.md @@ -36,6 +36,7 @@ The **Disable-AzStorageContainerDeleteRetentionPolicy** cmdlet disables delete r ## EXAMPLES ### Example 1: Disable delete retention policy for blob containers + ``` C:\PS>Disable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md index 6beb8833daf3..7d3924c2822c 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageBlobDeleteRetentionPolicy.md @@ -37,6 +37,7 @@ The **Enable-AzStorageBlobDeleteRetentionPolicy** cmdlet enables delete retentio ## EXAMPLES ### Example 1: Enable delete retention policy for the Blob service + ``` C:\PS>Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -AllowPermanentDelete -PassThru -RetentionDays 4 diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md b/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md index 200f2bed8c85..f0ca168a86e3 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageBlobLastAccessTimeTracking.md @@ -30,6 +30,7 @@ The **Enable-AzStorageBlobLastAccessTimeTracking** cmdlet enables last access ti ## EXAMPLES ### Example 1: Enable last access time tracking for the Blob service + ``` C:\PS>Enable-AzStorageBlobLastAccessTimeTracking -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageBlobRestorePolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageBlobRestorePolicy.md index 74322c92df1e..7ab0be2d2b36 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageBlobRestorePolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageBlobRestorePolicy.md @@ -37,6 +37,7 @@ The **Enable-AzStorageBlobRestorePolicy** cmdlet enables Blob Restore Policy for ## EXAMPLES ### Example 1: Enables Blob Restore Policy for the Azure Storage Blob service on a Storage account + ```powershell PS C:\> Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName "myresourcegoup" -StorageAccountName "mystorageaccount" -RetentionDays 5 diff --git a/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md b/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md index 53262b585873..0224c037785e 100644 --- a/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md +++ b/src/Storage/Storage.Management/help/Enable-AzStorageContainerDeleteRetentionPolicy.md @@ -37,6 +37,7 @@ The **Enable-AzStorageContainerDeleteRetentionPolicy** cmdlet enables delete ret ## EXAMPLES ### Example 1: Enable delete retention policy for Blob containers + ``` C:\PS>Enable-AzStorageContainerDeleteRetentionPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -PassThru -RetentionDays 3 diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md index 653ddb3db9f8..20be17a32d64 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ChildItem.md @@ -25,6 +25,7 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: List the direct sub items from a Filesystem + ``` PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" @@ -39,6 +40,7 @@ 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 + ``` PS C:\>Get-AzDataLakeGen2ChildItem -FileSystem "filesystem1" -Path "dir1/" -Recurse -FetchProperty diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md index 305b14910616..ab0148635cdf 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2Item.md @@ -24,6 +24,7 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Get a directory from a Filesystem, and show the details + ``` PS C:\> $dir1 = Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" PS C:\> $dir1 @@ -92,6 +93,7 @@ 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 + ``` PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" diff --git a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md index 55962b0ae732..c68c1229c2dc 100644 --- a/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md +++ b/src/Storage/Storage.Management/help/Get-AzDataLakeGen2ItemContent.md @@ -33,6 +33,7 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Download a file without prompt + ``` PS C:\> Get-AzDataLakeGen2ItemContent -FileSystem "filesystem1" -Path "dir1/file1" -Destination $localDestFile -Force @@ -46,6 +47,7 @@ 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 + ``` PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Get-AzDataLakeGen2ItemContent -Destination $localDestFile diff --git a/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md index 57c4a58f57d6..3413f139fd94 100644 --- a/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/Get-AzRmStorageContainer.md @@ -52,6 +52,7 @@ PS C:\>Get-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "m 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. + ``` PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -IncludeDeleted diff --git a/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md index 3f7e03a04585..59791fb2f959 100644 --- a/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Get-AzRmStorageShare.md @@ -48,6 +48,7 @@ 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 + ``` PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" @@ -61,6 +62,7 @@ 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 + ``` PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" @@ -75,6 +77,7 @@ 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. + ``` Get-AzStorageAccount -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Get-AzRmStorageShare -Name "myshare" @@ -88,6 +91,7 @@ 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 + ``` PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -GetShareUsage @@ -101,6 +105,7 @@ 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 + ``` PS C:\> Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -IncludeDeleted -IncludeSnapshot @@ -116,6 +121,7 @@ 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 + ``` PS C:\> Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "testshare1" -SnapshotTime "2021-05-10T08:04:08Z" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccount.md b/src/Storage/Storage.Management/help/Get-AzStorageAccount.md index 439fa500e8ed..3332cabd2d3b 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccount.md @@ -58,6 +58,7 @@ PS C:\>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 diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md index 48656f285bf7..1cfbcb6d594b 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountKey.md @@ -31,6 +31,7 @@ PS C:\>Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount This command gets the keys for the specified Azure Storage account. ### Example 2: Get a specific access key for a Storage account + ``` This command gets a specific key for a Storage account. This command works for Azure PowerShell version 1.4, and later versions. PS C:\>(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount")| Where-Object {$_.KeyName -eq "key1"} diff --git a/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md index d1a6ab5980bf..c1ac75ec6ccf 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageAccountManagementPolicy.md @@ -36,6 +36,7 @@ The **Get-AzStorageAccountManagementPolicy** cmdlet gets the management policy o ## EXAMPLES ### Example 1: Get the management policy of a Storage account. + ``` PS C:\>Get-AzStorageAccountManagementPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md index d0a3d82fa006..c8164b9f9b75 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlob.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlob.md @@ -59,6 +59,7 @@ PS C:\>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 + ``` PS C:\>Get-AzStorageContainer -Name container* | Get-AzStorageBlob -IncludeDeleted @@ -106,6 +107,7 @@ 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 + ``` PS C:\>Get-AzStorageBlob -Container "containername" -IncludeVersion @@ -123,6 +125,7 @@ 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 + ``` PS C:\> Get-AzStorageBlob -Container "containername" -Blob blob2 -VersionId "2020-07-03T16:19:16.2883167Z" @@ -136,6 +139,7 @@ blob2 BlockBlob 2097152 application/octet-stream 20 This command gets a single blobs verion with VersionId. ### Example 7: Get a single blob snapshot + ``` PS C:\> Get-AzStorageBlob -Container "containername" -Blob blob1 -SnapshotTime "2020-07-06T06:56:06.8588431Z" @@ -149,6 +153,7 @@ blob1 BlockBlob 2097152 application/octet-stream 20 This command gets a single blobs snapshot with SnapshotTime. ### Example 8: Get blob include blob tags + ``` PS C:\> $blobs = Get-AzStorageBlob -Container "containername" -IncludeTag @@ -172,6 +177,7 @@ 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 + ``` PS C:\> Get-AzStorageBlob -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md index 9681ec2de7c7..aa0c6aa1f4a6 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobByTag.md @@ -25,6 +25,7 @@ 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. + ``` PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -Context $ctx @@ -46,6 +47,7 @@ testblob4 This command lists all blobs in a storage accoun, which contains a tag with name "tag1" and value "value1". ### Example 2: List blobs in a specific container and match a specific blob tag + ``` PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression "@container='containername' AND ""tag1""='value1'" -Context $ctx @@ -60,6 +62,7 @@ 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. + ``` PS C:\> Get-AzStorageBlobByTag -TagFilterSqlExpression """tag1""='value1'" -GetBlobProperty diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobInventoryPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobInventoryPolicy.md index c9fa637a4f29..01262398f108 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobInventoryPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobInventoryPolicy.md @@ -36,6 +36,7 @@ The **Get-AzStorageBlobInventoryPolicy** cmdlet gets blob inventory policy from ## EXAMPLES ### Example 1: Get blob inventory policy from a Storage account + ``` PS C:\> $policy = Get-AzStorageBlobInventoryPolicy -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md index 6eda26febcb2..5693cb0acf3d 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobQueryResult.md @@ -50,6 +50,7 @@ The **Get-AzStorageBlobQueryResult** cmdlet applies a simple Structured Query La ## EXAMPLES ### Example 1: Query a blob + ```powershell PS C:\> $inputconfig = New-AzStorageBlobQueryConfig -AsCsv -HasHeader @@ -69,6 +70,7 @@ BytesScanned FailureCount BlobQueryError This command querys a blob succsssfully with input config as csv, and output config as json, and save the output to local file "c:\resultfile.json". ### Example 2: Query a blob snapshot + ```powershell PS C:\> $blob = Get-AzStorageBlob -Container $containerName -Blob $blobName -SnapshotTime "2020-07-29T11:08:21.1097874Z" -Context $ctx diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md index ec918e2b9002..0f60b0c62f23 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobServiceProperty.md @@ -36,6 +36,7 @@ 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" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md b/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md index affc1057d3a7..3c2adeb17d28 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageBlobTag.md @@ -42,6 +42,7 @@ The **Get-AzStorageBlobTag** gets blob tags of a specific blob. ## EXAMPLES ### Example 1: Get blob tags on a specific blob + ``` PS C:\> Get-AzStorageBlobTag -Container "containername" -Blob testblob @@ -54,6 +55,7 @@ tag2 value2 This command gets blob tags on a specific blob. ### Example 2: Get blob tags on a specific blob with tag condition + ``` PS C:\> Get-AzStorageBlobTag -Container "containername" -Blob testblob -TagCondition """tag1""='value1'" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageContainer.md b/src/Storage/Storage.Management/help/Get-AzStorageContainer.md index fdda4e5a3970..f53e21ae98ae 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageContainer.md @@ -49,6 +49,7 @@ PS C:\>Get-AzStorageContainer -Prefix "container" This example uses the *Prefix* parameter to return a list of all containers with a name that starts with container. ### Example 3: List Azure Storage container, include deleted containers + ``` PS C:\> $containers = Get-AzStorageContainer -IncludeDeleted -Context $ctx diff --git a/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md index 9e9eba21b487..5cc637cd8c96 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageEncryptionScope.md @@ -30,6 +30,7 @@ The **Get-AzStorageEncryptionScope** cmdlet gets or lists encryption scopes from ## EXAMPLES ### Example 1: Get a single encryption scope + ``` PS C:\> Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName $scopename @@ -44,6 +45,7 @@ testscope Disabled Microsoft.Keyvault https://keyvalutname.vault.azure.net:443/k This command gets a single encryption scope. ### Example 2: List all encryption scopes of a Storage account + ``` PS C:\> Get-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md b/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md index 0c88e6c1fa80..ff5f7cf2b703 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md @@ -49,6 +49,7 @@ 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 + ``` PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Recursive | Sort-Object ClientIP,OpenTime @@ -65,6 +66,7 @@ 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 + ``` PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -First 2 @@ -77,6 +79,7 @@ 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 + ``` PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -skip 2 -First 4 diff --git a/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md index e66dafcdc063..162e08ec73ac 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageFileServiceProperty.md @@ -36,6 +36,7 @@ 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" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md b/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md index 80954568885d..88099fb007d9 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageObjectReplicationPolicy.md @@ -30,6 +30,7 @@ The **Get-AzStorageObjectReplicationPolicy** cmdlet gets or lists object replica ## EXAMPLES ### Example 1: Get an object replication policy with specific policy Id and show its rules. + ``` PS C:\> $policy = Get-AzStorageObjectReplicationPolicy -ResourceGroupName "myresourcegroup" -AccountName "mydestaccount" -PolicyId 56bfa11c-81ef-4f8d-b307-5e5386e16fba @@ -50,6 +51,7 @@ 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" diff --git a/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md b/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md index 3aaa5b10f643..0cc191c19c8e 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageServiceProperty.md @@ -23,6 +23,7 @@ The **Get-AzStorageServiceProperty** cmdlet gets the properties for Azure Storag ## EXAMPLES ### Example 1: Get Azure Storage services property of the Blob service + ``` C:\PS>Get-AzStorageServiceProperty -ServiceType Blob diff --git a/src/Storage/Storage.Management/help/Get-AzStorageUsage.md b/src/Storage/Storage.Management/help/Get-AzStorageUsage.md index bb7611679f7a..0094dc944a81 100644 --- a/src/Storage/Storage.Management/help/Get-AzStorageUsage.md +++ b/src/Storage/Storage.Management/help/Get-AzStorageUsage.md @@ -23,6 +23,7 @@ The **Get-AzStorageUsage** cmdlet gets the resource usage for Azure Storage for ## EXAMPLES ### Example 1: Get the storage resources usage of specified location + ``` PS C:\>Get-AzStorageUsage -Location 'West US' diff --git a/src/Storage/Storage.Management/help/Invoke-AzStorageAccountFailover.md b/src/Storage/Storage.Management/help/Invoke-AzStorageAccountFailover.md index b5a6d7219472..494fe5cb48e0 100644 --- a/src/Storage/Storage.Management/help/Invoke-AzStorageAccountFailover.md +++ b/src/Storage/Storage.Management/help/Invoke-AzStorageAccountFailover.md @@ -35,6 +35,7 @@ Please understand the following impact to your storage account before you initia ## EXAMPLES ### Example 1: Invoke failover of a Storage account + ``` PS C:\>$account = Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -IncludeGeoReplicationStats PS C:\>$account.GeoReplicationStats diff --git a/src/Storage/Storage.Management/help/Invoke-AzStorageAccountHierarchicalNamespaceUpgrade.md b/src/Storage/Storage.Management/help/Invoke-AzStorageAccountHierarchicalNamespaceUpgrade.md index ece42c8be71e..70b127dd0390 100644 --- a/src/Storage/Storage.Management/help/Invoke-AzStorageAccountHierarchicalNamespaceUpgrade.md +++ b/src/Storage/Storage.Management/help/Invoke-AzStorageAccountHierarchicalNamespaceUpgrade.md @@ -31,6 +31,7 @@ The **Invoke-AzStorageAccountHierarchicalNamespaceUpgrade** cmdlet can validate ## EXAMPLES ### Example 1: Validate a stroage account can be upgrade to enable HierarchicalNamespace, then upgrade it to enabled HierarchicalNamespace + ``` PS C:\> Invoke-AzStorageAccountHierarchicalNamespaceUpgrade -ResourceGroupName $rgname -Name $accountName -RequestType Validation True diff --git a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md index a3df6cd91b49..720e803d432e 100644 --- a/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Move-AzDataLakeGen2Item.md @@ -33,6 +33,7 @@ This cmdlet only works if Hierarchical Namespace is enabled for the Storage acco ## EXAMPLES ### Example 1: Move a fold in same Filesystem + ``` PS C:\> Move-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/" -DestFileSystem "filesystem1" -DestPath "dir3/" @@ -46,6 +47,7 @@ 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 + ``` PS C:\> Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" | Move-AzDataLakeGen2Item -DestFileSystem "filesystem2" -DestPath "dir2/file2" -Force @@ -59,6 +61,7 @@ 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 diff --git a/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md index 94d3d193335a..9cb73a51b931 100644 --- a/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/New-AzDataLakeGen2Item.md @@ -35,6 +35,7 @@ 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 + ``` PS C:\>New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/" -Directory -Permission rwxrwxrwx -Umask ---rw---- -Property @{"CacheControl" = "READ"; "ContentDisposition" = "True"} -Metadata @{"tag1" = "value1"; "tag2" = "value2" } @@ -48,6 +49,7 @@ 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 + ``` PS C:\> $task = New-AzDataLakeGen2Item -FileSystem "testfilesystem" -Path "dir1/dir2/file1" -Source "c:\sourcefile.txt" -Force -asjob PS C:\> $task | Wait-Job diff --git a/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md index b91a3c50d06a..f1756fc4ca1e 100644 --- a/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/New-AzRmStorageContainer.md @@ -63,6 +63,7 @@ PS C:\>New-AzRmStorageContainer -StorageAccount $accountObject -ContainerName "m This command creates a Storage blob container with Storage account object and container name, with public access as Blob. ### Example 3: Create a storage container with EncryptionScope setting + ``` PS C:\> $c = New-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -DefaultEncryptionScope "testscope" -PreventEncryptionScopeOverride $true @@ -85,6 +86,7 @@ This command creates a storage container with a defalt encryptionScope, and bloc Then show the related container properties. ### Example 4: Create an Azure storage container with RootSquash + ``` PS C:\> $container = New-AzRmStorageContainer -ResourceGroupName "myersourcegroup" -AccountName "mystorageaccount" -Name "mycontainer" -RootSquash AllSquash @@ -98,6 +100,7 @@ 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 @@ -327,4 +330,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -## RELATED LINKS \ No newline at end of file +## RELATED LINKS diff --git a/src/Storage/Storage.Management/help/New-AzRmStorageShare.md b/src/Storage/Storage.Management/help/New-AzRmStorageShare.md index 4057f11059c7..16aaaebdd856 100644 --- a/src/Storage/Storage.Management/help/New-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/New-AzRmStorageShare.md @@ -32,6 +32,7 @@ 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. + ``` PS C:\>New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -QuotaGiB 100 -Metadata @{"tag1" = "value1"; "tag2" = "value2" } @@ -45,6 +46,7 @@ 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 + ``` Get-AzStorageAccount -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | New-AzRmStorageShare -Name "myshare" @@ -58,6 +60,7 @@ myshare This command creates a Storage file share with Storage account object and share name. ### Example 3: Create a Storage file share with accesstier as Hot + ``` PS C:\>$share = New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -AccessTier Hot @@ -71,6 +74,7 @@ myshare Hot This command creates a Storage file share with accesstier as Hot. ### Example 4: Create a Storage file share snapshot of an existing share + ``` PS C:\>$shareSnapshot = New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -Snapshot @@ -84,6 +88,7 @@ myshare 20 This command creates a Storage file share snapshot of an existing base file share. ### Example 5: Create a Storage file share with EnabledProtocol proeprty as NFS, and RootSquash property as NoRootSquash + ``` PS C:\>$share = New-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -EnabledProtocol NFS -RootSquash NoRootSquash diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccount.md b/src/Storage/Storage.Management/help/New-AzStorageAccount.md index eb04a84b7b1b..2eca9abd3e03 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccount.md @@ -121,6 +121,7 @@ PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorag This command creates a Storage account withenable Files Active Directory Domain Service Authentication and DefaultSharePermission. ### Example 8: Create a Storage account with Queue and Table Service use account-scoped encryption key, and Require Infrastructure Encryption. + ```powershell PS C:\>New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -EncryptionKeyTypeForTable Account -EncryptionKeyTypeForQueue Account -RequireInfrastructureEncryption @@ -146,6 +147,7 @@ This command creates a Storage account with Queue and Table Service use account- Then get the Storage account properties, and view the encryption keytype of Queue and Table Service, and RequireInfrastructureEncryption value. ### Example 9: Create account MinimumTlsVersion and AllowBlobPublicAccess, and disable SharedKey Access + ``` PS C:\> $account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -Kind StorageV2 -MinimumTlsVersion TLS1_1 -AllowBlobPublicAccess $false -AllowSharedKeyAccess $false @@ -162,6 +164,7 @@ False The command create account with MinimumTlsVersion, AllowBlobPublicAccess, and disable SharedKey access to the account, and then show the the 3 properties of the created account ### Example 10: Create a Storage account with RoutingPreference setting + ```powershell PS C:\>$account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "eastus2euap" -SkuName "Standard_LRS" -PublishMicrosoftEndpoint $true -PublishInternetEndpoint $true -RoutingChoice MicrosoftRouting @@ -188,6 +191,7 @@ InternetEndpoints : {"Blob":"https://mystorageaccount-internetrouting.blob.core This command creates a Storage account with RoutingPreference setting: PublishMicrosoftEndpoint and PublishInternetEndpoint as true, and RoutingChoice as MicrosoftRouting. ### Example 11: Create a Storage account with EdgeZone and AllowCrossTenantReplication + ```powershell PS C:\>$account = New-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -SkuName Premium_LRS -Location westus -EdgeZone "microsoftlosangeles1" -AllowCrossTenantReplication $false @@ -204,6 +208,7 @@ False This command creates a Storage account with EdgeZone as "microsoftlosangeles1" and AllowCrossTenantReplication as false, then show the created account related properties. ### Example 12: Create a Storage account with KeyExpirationPeriod and SasExpirationPeriod + ```powershell PS C:\> $account = New-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -SkuName Premium_LRS -Location eastus -KeyExpirationPeriodInDay 5 -SasExpirationPeriod "1.12:05:06" @@ -217,6 +222,7 @@ PS C:\> $account.SasPolicy.SasExpirationPeriod This command creates a Storage account with KeyExpirationPeriod and SasExpirationPeriod, then show the created account related properties. ### Example 12: Create a Storage account with Keyvault encryption (access Keyvault with user assigned identity) + ```powershell # Create KeyVault (no need if using exist keyvault) PS C:\> $keyVault = New-AzKeyVault -VaultName $keyvaultName -ResourceGroupName $resourceGroupName -Location eastus2euap -EnablePurgeProtection @@ -250,6 +256,7 @@ 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"; virtualNetworkRules=(@{VirtualNetworkResourceId="$vnet1";Action="allow"}); @@ -261,6 +268,7 @@ 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 + ``` PS C:\> $account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -PublicNetworkAccess Disabled @@ -271,6 +279,7 @@ Disabled The command creates account with disable PublicNetworkAccess of the account. ### Example 15: Create account with account level mmutability policy + ``` PS C:\> $account = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName Standard_LRS -Location centraluseuap -Kind StorageV2 -EnableAccountLevelImmutability -ImmutabilityPeriod 1 -ImmutabilityPolicyState Unlocked diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyFilter.md b/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyFilter.md index 23cb6ccda129..f668597c8c3f 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyFilter.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyFilter.md @@ -23,6 +23,7 @@ The **New-AzStorageAccountManagementPolicyFilter** cmdlet creates a ManagementPo ## EXAMPLES ### Example 1: Creates a ManagementPolicy rule filter object, then add it to a management policy rule and set to a Storage account + ``` PS C:\>$filter = New-AzStorageAccountManagementPolicyFilter -PrefixMatch blobprefix1,blobprefix2 -BlobType appendBlob,blockBlob PS C:\>$filter diff --git a/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyRule.md b/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyRule.md index 2b7e5aac085d..1f75c9ca21fd 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyRule.md +++ b/src/Storage/Storage.Management/help/New-AzStorageAccountManagementPolicyRule.md @@ -23,6 +23,7 @@ The **New-AzStorageAccountManagementPolicyRule** cmdlet creates a ManagementPoli ## EXAMPLES ### Example 1: Creates a ManagementPolicy rule object, then set to a Storage Account + ``` PS C:\>$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -daysAfterModificationGreaterThan 100 PS C:\>$action = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -InputObject $action diff --git a/src/Storage/Storage.Management/help/New-AzStorageBlobInventoryPolicyRule.md b/src/Storage/Storage.Management/help/New-AzStorageBlobInventoryPolicyRule.md index d7eea27869c1..510684642515 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageBlobInventoryPolicyRule.md +++ b/src/Storage/Storage.Management/help/New-AzStorageBlobInventoryPolicyRule.md @@ -32,6 +32,7 @@ The **New-AzStorageBlobInventoryPolicyRule** cmdlet creates a blob inventory pol ## EXAMPLES ### Example 1: Create blob inventory policy rule objects, then sets blob inventory policy with the rule objects. + ``` PS C:\> $rule1 = New-AzStorageBlobInventoryPolicyRule -Name Test1 -Destination $containerName -Disabled -Format Csv -Schedule Daily -ContainerSchemaField Name,Metadata,PublicAccess,Last-mOdified,LeaseStatus,LeaseState,LeaseDuration,HasImmutabilityPolicy,HasLegalHold -PrefixMatch con1,con2 diff --git a/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md b/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md index 4ed99ba11edf..00cbe602d38a 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md +++ b/src/Storage/Storage.Management/help/New-AzStorageBlobQueryConfig.md @@ -29,6 +29,7 @@ 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 diff --git a/src/Storage/Storage.Management/help/New-AzStorageContainer.md b/src/Storage/Storage.Management/help/New-AzStorageContainer.md index d0d4af3817fd..154b6a6bba54 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/New-AzStorageContainer.md @@ -49,6 +49,7 @@ This example creates multiple storage containers. It uses the **Split** method of the .NET **String** class and then passes the names on the pipeline. ### Example 3: Create an Azure storage container with Encryption Scope + ``` PS C:\> $container = New-AzStorageContainer -Name "mycontainer" -DefaultEncryptionScope "myencryptscope" -PreventEncryptionScopeOverride $true diff --git a/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md index 57251ab6e73c..eadba5b80dc6 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/New-AzStorageEncryptionScope.md @@ -46,6 +46,7 @@ The **New-AzStorageEncryptionScope** cmdlet creates an encryption scope for a St ## EXAMPLES ### Example 1: Create an encryption scope with Storage Encryption + ``` PS C:\> New-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption @@ -59,6 +60,7 @@ 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" ` -EncryptionScopeName testscope -KeyvaultEncryption -KeyUri "https://keyvalutname.vault.azure.net:443/keys/keyname/34a0ba563b4243d9a0ef2b1d3c0c7d57" ` diff --git a/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md b/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md index e2248320dd89..ccc8fdf8807b 100644 --- a/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md +++ b/src/Storage/Storage.Management/help/New-AzStorageObjectReplicationPolicyRule.md @@ -24,6 +24,7 @@ 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 @@ -37,6 +38,7 @@ 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 diff --git a/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2AclRecursive.md b/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2AclRecursive.md index 5c4c646320ae..e3033d7b8405 100644 --- a/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2AclRecursive.md +++ b/src/Storage/Storage.Management/help/Remove-AzDataLakeGen2AclRecursive.md @@ -26,6 +26,7 @@ The ACL entries in original ACL, which has same AccessControlType, DefaultScope ## EXAMPLES ### Example 1: Remove ACL recursively on a root directiry of filesystem + ``` PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission r-x -DefaultScope PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission r-x -InputObject $acl @@ -42,6 +43,7 @@ ContinuationToken : This command first creates an ACL object with 2 acl entries, then removes ACL recursively on a root directory of a file system. ### Example 2: Remove ACL recursively on a directory + ``` PS C:\> $result = Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -Context $ctx WARNING: To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission. @@ -77,6 +79,7 @@ ContinuationToken : This command first removes ACL recursively on a directory and failed, then resume with ContinuationToken after user fix the failed file. ### Example 3: Remove ACL recursively chunk by chunk + ``` $token = $null $TotalDirectoriesSuccess = 0 @@ -106,6 +109,7 @@ echo "FailedEntries:"$($FailedEntries | ft) This script will remove ACL rescursively on directory chunk by chunk, with chunk size as BatchSize * MaxBatchCount. Chunk size is 50000 in this script. ### Example 4: Remove ACL recursively on a directory and ContinueOnFailure, then resume from failures one by one + ``` PS C:\> $result = Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -ContinueOnFailure -Context $ctx diff --git a/src/Storage/Storage.Management/help/Remove-AzStorageBlobImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Remove-AzStorageBlobImmutabilityPolicy.md index 155d87f1ae9c..bf1de687aa0d 100644 --- a/src/Storage/Storage.Management/help/Remove-AzStorageBlobImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Remove-AzStorageBlobImmutabilityPolicy.md @@ -34,6 +34,7 @@ The **Remove-AzStorageBlobImmutabilityPolicy** cmdlet removes immutability polic ## EXAMPLES ### Example 1: Removes immutability policy of a Storage blob. + ``` PS C:\> $blob = Remove-AzStorageBlobImmutabilityPolicy -Container $containerName -Blob $blobname diff --git a/src/Storage/Storage.Management/help/Restore-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Restore-AzRmStorageShare.md index 49e1abd956a7..41d6f9ba70c3 100644 --- a/src/Storage/Storage.Management/help/Restore-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Restore-AzRmStorageShare.md @@ -37,6 +37,7 @@ The **Restore-AzRmStorageShare** cmdlet restores a deleted file share within a v ## EXAMPLES ### Example 1: Remove and restore a share + ```powershell PS C:\> Remove-AzRmStorageShare -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -Name $shareName -Force diff --git a/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md b/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md index 85f7894e951b..b7909d93864d 100644 --- a/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md +++ b/src/Storage/Storage.Management/help/Restore-AzStorageBlobRange.md @@ -40,6 +40,7 @@ The start range is included, and the end range is excluded in blob restore. ## EXAMPLES ### Example 1: Start restores blobs in a Storage account with specific blob ranges + ```powershell PS C:\> $range1 = New-AzStorageBlobRangeToRestore -StartRange container1/blob1 -EndRange container2/blob2 PS C:\> $range2 = New-AzStorageBlobRangeToRestore -StartRange container3/blob3 -EndRange container4/blob4 @@ -59,6 +60,7 @@ 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 @@ -74,6 +76,7 @@ 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 ` -TimeToRestore (Get-Date).AddSeconds(-1) ` diff --git a/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md b/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md index d0bfa58e791e..ec4d95b03ccb 100644 --- a/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md +++ b/src/Storage/Storage.Management/help/Restore-AzStorageContainer.md @@ -24,6 +24,7 @@ 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 + ``` PS C:\> Get-AzStorageContainer -IncludeDeleted -Context $ctx | Where-Object { $_.IsDeleted } | Restore-AzStorageContainer @@ -38,6 +39,7 @@ container2 Off This command lists all containers include deleted containers, filter out all the deleted containers, then restore all deleted container to the same container name with pipeline. ### Example 2: Restore a single deleted container + ``` PS C:\> Get-AzStorageContainer -IncludeDeleted -Context $ctx | Where-Object { $_.IsDeleted } diff --git a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md index 8502e5f374ba..9d5b1d08aa2f 100644 --- a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md +++ b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2AclRecursive.md @@ -26,6 +26,7 @@ The input ACL will replace original ACL completely. ## EXAMPLES ### Example 1: Set ACL recursively on a directory + ``` PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl @@ -42,6 +43,7 @@ ContinuationToken : This command first creates an ACL object with 3 acl entries, then sets ACL recursively on a directory. ### Example 2: Set ACL recursively on a root directory of filesystem + ``` PS C:\> $result = Set-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Acl $acl -Context $ctx @@ -75,6 +77,7 @@ ContinuationToken : This command first sets ACL recursively to a root directory and failed, then resume with ContinuationToken after user fix the failed file. ### Example 3: Set ACL recursively chunk by chunk + ``` $token = $null $TotalDirectoriesSuccess = 0 @@ -104,6 +107,7 @@ echo "FailedEntries:"$($FailedEntries | ft) This script sets ACL rescursively on directory chunk by chunk, with chunk size as BatchSize * MaxBatchCount. Chunk size is 200 in this script. ### Example 4: Set ACL recursively on a directory and ContinueOnFailure, then resume from failures one by one + ``` PS C:\> $result = Set-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -ContinueOnFailure -Context $ctx diff --git a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md index 986ef40d5224..da533b41640d 100644 --- a/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md +++ b/src/Storage/Storage.Management/help/Set-AzDataLakeGen2ItemAclObject.md @@ -24,6 +24,7 @@ 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 + ``` PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl @@ -40,6 +41,7 @@ dir1/dir3 True 2020-03-23 09:34:31Z rwxrw-rw- This command creates an ACL object with 3 ACL entries (use -InputObject parameter to add acl entry to existing acl object), and updates ACL on a directory. ### Example 2: Create an ACL object with 4 ACL entries, and update permission of an existing ACL entry + ``` PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx -DefaultScope PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl diff --git a/src/Storage/Storage.Management/help/Set-AzStorageAccount.md b/src/Storage/Storage.Management/help/Set-AzStorageAccount.md index 70aaffa92c8e..3549b60693b1 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageAccount.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageAccount.md @@ -151,6 +151,7 @@ PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystora 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. + ``` PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -EnableAzureActiveDirectoryDomainServicesForFile $true -DefaultSharePermission StorageFileDataSmbShareOwner @@ -164,6 +165,7 @@ AADDS Microsoft.Azure.Commands.Management.Storage.Models.PSAct The command update a Storage account by enable Azure Files AAD DS Authentication. ### Example 11: Update a Storage account by enable Files Active Directory Domain Service Authentication, and then show the File Identity Based authentication setting + ``` PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -EnableActiveDirectoryDomainServicesForFile $true ` -ActiveDirectoryDomainName "mydomain.com" ` @@ -193,6 +195,7 @@ AccountType : Computer The command updates a Storage account by enable Azure Files Active Directory Domain Service Authentication, and then shows the File Identity Based authentication setting ### Example 12: Set MinimumTlsVersion, AllowBlobPublicAccess and AllowSharedKeyAccess + ``` PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -MinimumTlsVersion TLS1_1 -AllowBlobPublicAccess $false -AllowSharedKeyAccess $true @@ -209,6 +212,7 @@ True The command sets MinimumTlsVersion, AllowBlobPublicAccess and AllowSharedKeyAccess, and then show the the 3 properties of the account ### Example 13: Update a Storage account with RoutingPreference setting + ```powershell PS C:\>$account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -PublishMicrosoftEndpoint $false -PublishInternetEndpoint $true -RoutingChoice InternetRouting @@ -234,6 +238,7 @@ InternetEndpoints : {"Blob":"https://mystorageaccount-internetrouting.blob.core This command updates a Storage account with RoutingPreference setting: PublishMicrosoftEndpoint as false, PublishInternetEndpoint as true, and RoutingChoice as MicrosoftRouting. ### Example 14: Update a Storage account with KeyExpirationPeriod and SasExpirationPeriod + ```powershell PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "myresourcegroup" -Name "mystorageaccount" -KeyExpirationPeriodInDay 5 -SasExpirationPeriod "1.12:05:06" -EnableHttpsTrafficOnly $true @@ -247,6 +252,7 @@ PS C:\> $account.SasPolicy.SasExpirationPeriod This command updates a Storage account with KeyExpirationPeriod and SasExpirationPeriod, then show the updated account related properties. ### Example 15: Update a Storage account to Keyvault encryption, and access Keyvault with user assigned identity + ```powershell # Create KeyVault (no need if using exist keyvault) PS C:\> $keyVault = New-AzKeyVault -VaultName $keyvaultName -ResourceGroupName $resourceGroupName -Location eastus2euap -EnablePurgeProtection @@ -277,6 +283,7 @@ LastKeyRotationTimestamp : 4/12/2021 8:17:57 AM This command first creates a keyvault and a user assigned identity, then updates a storage account with keyvault encryption, the storage access access keyvault with the user assigned identity. ### Example 16: Update a Keyvault encrypted Storage account, from access Keyvault with user assigned identity, to access Keyvault with system assigned identity + ```powershell # Assign System identity to the account, and give the system assigned identity acces to the keyvault PS C:\> $account = Set-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -IdentityType SystemAssignedUserAssigned @@ -315,6 +322,7 @@ 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 @@ -325,6 +333,7 @@ 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 @@ -335,6 +344,7 @@ Enabled This command updates a Storage account by set PublicNetworkAccess as enabled. ### Example 19: Update account level mmutability policy + ``` PS C:\> $account = Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -ImmutabilityPeriod 2 -ImmutabilityPolicyState Unlocked diff --git a/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md index 1d0180fd422c..c29adb4782b8 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageAccountManagementPolicy.md @@ -56,6 +56,7 @@ 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. + ``` PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -BaseBlobAction Delete -DaysAfterCreationGreaterThan 100 PS C:\>$action1 = Add-AzStorageAccountManagementPolicyAction -InputObject $action1 -BaseBlobAction TierToArchive -daysAfterModificationGreaterThan 50 -DaysAfterLastTierChangeGreaterThan 30 @@ -171,6 +172,7 @@ 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 (@{ Rules=(@{ diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md index d0bcaacf5fc0..108c33654e52 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobContent.md @@ -93,6 +93,7 @@ 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 + ``` 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 @@ -108,6 +109,7 @@ 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 + ``` PS C:\> $blob = Set-AzStorageBlobContent -File "mylocalfile" -Container "mycontainer" -Blob "myblob" -EncryptionScope "myencryptscope" diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobImmutabilityPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobImmutabilityPolicy.md index 4718994058a6..384da20ec87e 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobImmutabilityPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobImmutabilityPolicy.md @@ -37,6 +37,7 @@ The cmdlet only works when the blob container has already enabled immutable Stor ## EXAMPLES ### Example 1: Create or update immutability policy of a Storage blob. + ``` PS C:\> $blob = Set-AzStorageBlobImmutabilityPolicy -Container $containerName -Blob $blobname -ExpiresOn (Get-Date).AddDays(100) -PolicyMode Unlocked diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md index 186121abdd00..c2b21d58d0ba 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobInventoryPolicy.md @@ -56,6 +56,7 @@ The **Set-AzStorageBlobInventoryPolicy** cmdlet creates or updates blob inventor ## EXAMPLES ### Example 1: Create or update the blob inventory policy with BlobInventoryPolicy rule objects. + ``` PS C:\> $rule1 = New-AzStorageBlobInventoryPolicyRule -Name Test1 -Destination $containerName -Disabled -Format Csv -Schedule Daily -ContainerSchemaField Name,Metadata,PublicAccess,Last-mOdified,LeaseStatus,LeaseState,LeaseDuration,HasImmutabilityPolicy,HasLegalHold -PrefixMatch con1,con2 @@ -87,6 +88,7 @@ This first 2 commands create 2 BlobInventoryPolicy rule objects: rule "Test1" fo The following command sets blob inventory policy to a Storage account with the 2 rule objects, then show the updated policy and rules properties. ### Example 2: Create or update the blob inventory policy of a Storage account with a Json format policy. + ``` PS C:\> $policy = Set-AzStorageBlobInventoryPolicy -ResourceGroupName $resourceGroupName -StorageAccountName $accountName -Policy (@{ Enabled=$true; diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobLegalHold.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobLegalHold.md index 964ff0cf6503..d4a4970dd1c3 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobLegalHold.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobLegalHold.md @@ -51,6 +51,7 @@ The cmdlet only works when the blob container has already enabled immutable Stor ## EXAMPLES ### Example 1: Enable legal hold on a Storage blob. + ``` PS C:\> $blob = Set-AzStorageBlobLegalHold -Container $containerName -Blob $blobname -EnableLegalHold @@ -70,6 +71,7 @@ This command enables legal hold on a Storage blob, then show the result. The command only works when the blob container has already enabled immutable Storage with versioning. ### Example 2: Disable legal hold on a Storage blob with pipeline. + ``` PS C:\> $blob = Get-AzStorageBlob -Container $containerName -Blob $blobname | Set-AzStorageBlobLegalHold -DisableLegalHold diff --git a/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md b/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md index f63ccd1921c1..e1019eaab7b2 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageBlobTag.md @@ -42,6 +42,7 @@ The **Set-AzStorageBlobTag** sets blob tags of a specific blob. ## EXAMPLES ### Example 1: Set blob tags on a specific blob + ``` PS C:\> Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } @@ -54,6 +55,7 @@ tag1 value1 This command sets blob tags on a specific blob. ### Example 2: Set blob tags on a specific blob with tag condition + ``` PS C:\> Set-AzStorageBlobTag -Container "containername" -Blob testblob -Tag @{"tag1" = "value1"; "tag2" = "value2" } -TagCondition """tag1""='value1'" diff --git a/src/Storage/Storage.Management/help/Set-AzStorageObjectReplicationPolicy.md b/src/Storage/Storage.Management/help/Set-AzStorageObjectReplicationPolicy.md index 9cc8e3ddc341..5e3eb78abd8f 100644 --- a/src/Storage/Storage.Management/help/Set-AzStorageObjectReplicationPolicy.md +++ b/src/Storage/Storage.Management/help/Set-AzStorageObjectReplicationPolicy.md @@ -40,6 +40,7 @@ The **Set-AzStorageObjectReplicationPolicy** cmdlet creates or updates the speci ## EXAMPLES ### Example 1: Set object replication policy to both destination and source account. + ``` PS C:\> $rule1 = New-AzStorageObjectReplicationPolicyRule -SourceContainer src1 -DestinationContainer dest1 diff --git a/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md b/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md index 620afc483af1..fed5e71079d1 100644 --- a/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md +++ b/src/Storage/Storage.Management/help/Stop-AzStorageAccountHierarchicalNamespaceUpgrade.md @@ -30,6 +30,7 @@ The **Stop-AzStorageAccountHierarchicalNamespaceUpgrade** cmdlet can aborts an o ## EXAMPLES ### Example 1: Abort HierarchicalNamespace upgrade task on a stroage account + ``` PS C:\> Stop-AzStorageAccountHierarchicalNamespaceUpgrade -ResourceGroupName $rgname -Name $accountName -Force -PassThru True diff --git a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md index 9dc5cfe917ee..10dcafe3de45 100644 --- a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md +++ b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2AclRecursive.md @@ -26,6 +26,7 @@ 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 + ``` PS C:\>$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx PS C:\>$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl @@ -42,6 +43,7 @@ ContinuationToken : This command first creates an ACL object with 3 acl entries, then updates ACL recursively on a root directory of a file system. ### Example 2: Update ACL recursively on a directory, and resume from failure with ContinuationToken + ``` PS C:\> $result = Update-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -Context $ctx @@ -75,6 +77,7 @@ ContinuationToken : This command first updateds ACL recursively to a directory and failed, then resume with ContinuationToken after user fix the failed file. ### Example 3: Update ACL recursively chunk by chunk + ``` $ContinueOnFailure = $true # Set it to $false if want to terminate the operation quickly on encountering failures $token = $null @@ -113,6 +116,7 @@ echo "FailedEntries:"$($FailedEntries | ft) This script will update ACL rescursively on directory chunk by chunk, with chunk size as BatchSize * MaxBatchCount. Chunk size is 5000 in this script. ### Example 4: Update ACL recursively on a directory and ContinueOnFailure, then resume from failures one by one + ``` PS C:\> $result = Update-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -ContinueOnFailure -Context $ctx diff --git a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md index 432243a4960d..6ead34f53d29 100644 --- a/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md +++ b/src/Storage/Storage.Management/help/Update-AzDataLakeGen2Item.md @@ -35,6 +35,7 @@ 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 + ``` PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rwx PS C:\>$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl @@ -53,6 +54,7 @@ dir2 True 2020-03-23 09:28:36Z rwxrw-rw- This command first creates an ACL object with 3 acl entry (use -InputObject parameter to add acl entry to existing acl object), then get all items in a filesystem and update acl on the items. ### Example 2: Update all properties on a file, and show them + ``` PS C:\> $file = Update-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1" ` -Acl $acl ` @@ -128,6 +130,7 @@ 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 + ``` ## Get the origin ACL PS C:\> $acl = (Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path 'dir1/dir3/').ACL diff --git a/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md b/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md index 8547dd552197..bb0d3c662e9b 100644 --- a/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md +++ b/src/Storage/Storage.Management/help/Update-AzRmStorageContainer.md @@ -60,6 +60,7 @@ PS C:\>Get-AzRmStorageContainer -ResourceGroupName "myResourceGroup" -AccountNam This command set public access as Blob for all Storage blob containers in a Storage account with pipeline. ### Example 4: Update an Azure storage container with RootSquash + ``` PS C:\> $container = Update-AzRmStorageContainer -ResourceGroupName "myersourcegroup" -AccountName "mystorageaccount" -Name "mycontainer" -RootSquash NoRootSquash diff --git a/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md b/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md index 418b56467877..65a976f1eda4 100644 --- a/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md +++ b/src/Storage/Storage.Management/help/Update-AzRmStorageShare.md @@ -46,6 +46,7 @@ The **New-AzRmStorageShare** cmdlet modifies a Storage file share. ## EXAMPLES ### Example 1: Modifies a Storage file share's metadata and share quota with Storage account name and share name + ``` PS C:\>$share = Update-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -QuotaGiB 200 -Metadata @{tag0="value0";tag1="value1"} @@ -76,6 +77,7 @@ PS C:\>$share = Update-AzRmStorageShare -StorageAccount $accountObject -Name "my 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 + ``` PS C:\>Get-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" | Update-AzRmStorageShare -QuotaGiB 5000 @@ -90,6 +92,7 @@ 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 + ``` PS C:\>$share = Update-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -AccessTier Cool @@ -103,6 +106,7 @@ myshare Cool This command modifies a Storage file share with accesstier as Cool. ### Example 5: Modifies rootsquash for a file shares in a Storage account + ``` PS C:\>$share = Update-AzRmStorageShare -ResourceGroupName "myresourcegroup" -StorageAccountName "mystorageaccount" -Name "myshare" -RootSquash NoRootSquash diff --git a/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md b/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md index 3ea68febfd9d..e9d0dea26a7a 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageBlobServiceProperty.md @@ -40,6 +40,7 @@ The **Update-AzStorageBlobServiceProperty** cmdlet modifies the service properti ## EXAMPLES ### Example 1: Set Blob service DefaultServiceVersion to 2018-03-28 + ``` C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -DefaultServiceVersion 2018-03-28 @@ -58,6 +59,7 @@ 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 + ``` C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EnableChangeFeed $true -ChangeFeedRetentionInDays 5 @@ -80,6 +82,7 @@ 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 + ``` C:\PS> Update-AzStorageBlobServiceProperty -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -IsVersioningEnabled $true diff --git a/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md b/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md index db0c065d0ac8..16beb27f4ba3 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageEncryptionScope.md @@ -58,6 +58,7 @@ The **Update-AzStorageEncryptionScope** cmdlet modifies an encryption scope for ## EXAMPLES ### Example 1: Disable an encryption scope + ``` PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Disabled @@ -71,6 +72,7 @@ testscope Disabled Microsoft.Storage This command disables an encryption scope. ### Example 2: Enable an encryption scope + ``` PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -State Enabled @@ -84,6 +86,7 @@ testscope Enabled Microsoft.Storage This command enables an encryption scope. ### Example 3: Update an encryption scope to use Storage Encryption + ``` PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -StorageEncryption @@ -97,6 +100,7 @@ testscope Enabled Microsoft.Storage This command updates an encryption scope to use Storage Encryption. ### Example 4: Update an encryption scope to use Keyvault Encryption + ``` PS C:\> Update-AzStorageEncryptionScope -ResourceGroupName "myresourcegroup" -AccountName "mystorageaccount" -EncryptionScopeName testscope -KeyvaultEncryption -KeyUri "https://keyvalutname.vault.azure.net:443/keys/keyname/34a0ba563b4243d9a0ef2b1d3c0c7d57" diff --git a/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md b/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md index f19fee3e5804..09f76745e137 100644 --- a/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md +++ b/src/Storage/Storage.Management/help/Update-AzStorageFileServiceProperty.md @@ -45,6 +45,7 @@ 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 @@ -62,6 +63,7 @@ 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 @@ -79,6 +81,7 @@ 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" ` -SMBProtocolVersion SMB2.1,SMB3.0,SMB3.1.1 ` @@ -100,6 +103,7 @@ 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" ` -SMBProtocolVersion @() ` diff --git a/src/Synapse/Synapse/help/Invoke-AzSynapseDataFlowDebugSessionCommand.md b/src/Synapse/Synapse/help/Invoke-AzSynapseDataFlowDebugSessionCommand.md index 5f538d126701..d6bd477e6f09 100644 --- a/src/Synapse/Synapse/help/Invoke-AzSynapseDataFlowDebugSessionCommand.md +++ b/src/Synapse/Synapse/help/Invoke-AzSynapseDataFlowDebugSessionCommand.md @@ -39,6 +39,7 @@ Stop-AzSynapseDataFlowDebugSession ## EXAMPLES ### Example 1 + ```powershell $result = Invoke-AzSynapseDataFlowDebugSessionCommand -WorkspaceName ContosoWorkspace -Command executePreviewQuery -SessionId 3afb278e-ac5f-469f-a0b6-2f04c3ab59bc -StreamName source1 -RowLimit 100 -AsJob $result | Format-Table -wrap