Skip to content

Commit 401f1b1

Browse files
aladdindockceiw
andauthored
Aladdin generated examples for Accounts, KeyVault, Monitor, Storage (#11569)
* Add new examples to Accounts, KeyVault, Monitor, Storage - Add new examples to the following modules: Accounts KeyVault Monitor Storage * Add new examples to Accounts, KeyVault, Monitor, Storage - Add new examples to the following modules: Accounts KeyVault Monitor Storage * Fix up the type name. Co-authored-by: Maoliang Huang <[email protected]>
1 parent 34d5f9c commit 401f1b1

26 files changed

+162
-58
lines changed

src/Accounts/Accounts/help/Clear-AzContext.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Remove all Azure Credentials, account, and subscription information.
2222

2323
## EXAMPLES
2424

25-
### Clear global context
26-
```
25+
### Example 1: Clear global context
26+
```powershell
2727
PS C:\> Clear-AzContext -Scope CurrentUser
2828
```
2929

src/Accounts/Accounts/help/Clear-AzDefault.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ the user depending on the switch parameters specified by the user.
2424
## EXAMPLES
2525

2626
### Example 1
27-
```
27+
```powershell
2828
PS C:\> Clear-AzDefault
2929
```
3030

3131
This command removes all the defaults set by the user in the current context.
3232

33-
### Example 1
34-
```
33+
### Example 2
34+
```powershell
3535
PS C:\> Clear-AzDefault -ResourceGroup
3636
```
3737

src/Accounts/Accounts/help/Disable-AzContextAutosave.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@ Turn off autosaving Azure credentials. Your login information will be forgotten
2222

2323
## EXAMPLES
2424

25-
### Disable autosaving the context
26-
```
25+
### Example 1: Disable autosaving the context
26+
```powershell
2727
PS C:\> Disable-AzContextAutosave
2828
```
2929

3030
Disable autosave for the current user.
3131

32+
### Example 2
33+
34+
Turn off autosaving Azure credentials in this powershell session. (autogenerated)
35+
36+
```powershell <!-- Aladdin Generated Example -->
37+
Disable-AzContextAutosave -Scope Process
38+
```
39+
3240
## PARAMETERS
3341

3442
### -DefaultProfile

src/Accounts/Accounts/help/Disconnect-AzAccount.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ After executing this cmdlet, you will need to login again using Connect-AzAccoun
4848

4949
## EXAMPLES
5050

51-
### Logout of the current account
52-
```
51+
### Example 1: Logout of the current account
52+
```powershell
5353
PS C:\> Disconnect-AzAccount
5454
```
5555

5656
Logs out of the Azure account associated with the current context.
5757

58-
### Logout of the account associated with a particular context
59-
```
58+
### Example 2: Logout of the account associated with a particular context
59+
```powershell
6060
PS C:\> Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser
6161
```
6262

6363
Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted.
6464

65-
### Log out a particular user
66-
```
65+
### Example 3: Log out a particular user
66+
```powershell
6767
PS C:\> Disconnect-AzAccount -Username '[email protected]'
6868
```
6969

src/Accounts/Accounts/help/Enable-AzContextAutosave.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@ Allow the azure credential, account and subscription information to be saved and
2222

2323
## EXAMPLES
2424

25-
### Enable autosaving credentials for the current user
26-
```
25+
### Example 1: Enable autosaving credentials for the current user
26+
```powershell
2727
PS C:\> Enable-AzContextAutosave
2828
```
2929

3030
Turn on credential autosave for the current user. Whenever a powershell window is opened, your current context will be remembered without logging in.
3131

32+
### Example 2
33+
34+
Allow the azure credential, account and subscription information to be saved and automatically loaded when you open a PowerShell window in this powershell session. (autogenerated)
35+
36+
```powershell <!-- Aladdin Generated Example -->
37+
Enable-AzContextAutosave -Scope Process
38+
```
39+
3240
## PARAMETERS
3341

3442
### -DefaultProfile

src/Accounts/Accounts/help/Enable-AzureRmAlias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Enables AzureRm prefix aliases for Az modules. If -Module is specified, only mod
2323
## EXAMPLES
2424

2525
### Example 1
26-
```
26+
```powershell
2727
PS C:\> Enable-AzureRmAlias
2828
```
2929

3030
Enables all AzureRm prefixes for the current PowerShell session.
3131

32-
### Example 1
33-
```
32+
### Example 2
33+
```powershell
3434
PS C:\> Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser
3535
```
3636

src/Accounts/Accounts/help/Rename-AzContext.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ Rename an Azure context. By default contexts are named by user account and subs
3030

3131
## EXAMPLES
3232

33-
### Rename a context using named parameters
34-
```
33+
### Example 1: Rename a context using named parameters
34+
```powershell
3535
PS C:\> Rename-AzContext -SourceName "[[email protected]; 12345-6789-2345-3567890]" -TargetName "Work"
3636
```
3737

3838
Rename the context for '[email protected]' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using
3939
'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion.
4040

41-
### Rename a context using positional parameters
42-
```
41+
### Example 2: Rename a context using positional parameters
42+
```powershell
4343
PS C:\> Rename-AzContext "My context" "Work"
4444
```
4545

src/Accounts/Accounts/help/Select-AzContext.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ selected context.
3030

3131
## EXAMPLES
3232

33-
### Example 1 : Target a named context
34-
```
33+
### Example 1: Target a named context
34+
```powershell
3535
PS C:\> Select-AzContext "Work"
3636
3737
Name Account SubscriptionName Environment TenantId
@@ -41,6 +41,14 @@ Work [email protected] Subscription1 AzureCloud xxxxxxxx-x..
4141

4242
Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context.
4343

44+
### Example 2
45+
46+
Select a subscription and account to target in Azure PowerShell cmdlets in this powershell session. (autogenerated)
47+
48+
```powershell <!-- Aladdin Generated Example -->
49+
Select-AzContext -Name TestEnvironment -Scope Process
50+
```
51+
4452
## PARAMETERS
4553

4654
### -DefaultProfile

src/KeyVault/KeyVault/help/New-AzKeyVaultCertificatePolicy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ Updated :
7171

7272
This command creates a certificate policy that is valid for six months and reuses the key to renew the certificate.
7373

74+
### Example 2
75+
76+
Creates an in-memory certificate policy object. (autogenerated)
77+
78+
```powershell <!-- Aladdin Generated Example -->
79+
New-AzKeyVaultCertificatePolicy -IssuerName 'Self' -KeyType RSA -RenewAtNumberOfDaysBeforeExpiry <Int32> -SecretContentType application/x-pkcs12 -SubjectName 'CN=contoso.com' -ValidityInMonths 6
80+
```
81+
7482
## PARAMETERS
7583

7684
### -CertificateTransparency

src/KeyVault/KeyVault/help/Set-AzKeyVaultManagedStorageSasDefinition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Storage Account.
3535

3636
## EXAMPLES
3737

38-
### Example 1 : Set an account-type SAS definition, and obtain a current SAS token based on it
38+
### Example 1: Set an account-type SAS definition, and obtain a current SAS token based on it
3939
```powershell
4040
PS C:\> $sa = Get-AzStorageAccount -Name mysa -ResourceGroupName myrg
4141
PS C:\> $kv = Get-AzKeyVault -VaultName mykv

src/KeyVault/KeyVault/help/Update-AzKeyVaultCertificate.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ Updated : 8/1/2016 5:37:48 PM
6868
The first command assigns an array of key/value pairs to the $Tags variable.
6969
The second command sets the tags value of the certificate named TestCert01 to be $Tags.
7070

71+
### Example 2
72+
73+
Modifies editable attributes of a certificate. (autogenerated)
74+
75+
```powershell <!-- Aladdin Generated Example -->
76+
Update-AzKeyVaultCertificate -Enable $true -Name 'TestCert01' -VaultName 'ContosoKV01'
77+
```
78+
7179
## PARAMETERS
7280

7381
### -DefaultProfile

src/KeyVault/KeyVault/help/Update-AzKeyVaultManagedStorageAccount.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Tags :
5353
Updates the Key Vault managed Azure Storage Account active key to 'key2'. 'key2' will be used to
5454
generate SAS tokens after this update.
5555

56+
### Example 2
57+
58+
Update editable attributes of a Key Vault managed Azure Storage Account. (autogenerated)
59+
60+
```powershell <!-- Aladdin Generated Example -->
61+
Update-AzKeyVaultManagedStorageAccount -AccountName 'mystorageaccount' -AutoRegenerateKey $false -RegenerationPeriod $regenerationPeriod -VaultName 'myvault'
62+
```
63+
5664
## PARAMETERS
5765

5866
### -AccountName

src/KeyVault/KeyVault/help/Update-AzKeyVaultNetworkRuleSet.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ Tags :
8989

9090
This command updates the network ruleset on the vault named 'myVault' for the specified IP range and the virtual network, allowing bypassing of the network rule for Azure services.
9191

92+
### Example 2
93+
94+
Updates the network rule set on a key vault. (autogenerated)
95+
96+
```powershell <!-- Aladdin Generated Example -->
97+
Update-AzKeyVaultNetworkRuleSet -DefaultAction Allow -VaultName 'myVault'
98+
```
99+
92100
## PARAMETERS
93101

94102
### -Bypass

src/Monitor/Monitor/help/Add-AzLogProfile.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma
3030

3131
## EXAMPLES
3232

33-
### Example 1 : Add a new log profile to export the activity log matching the location condition to a storage account
34-
```
33+
### Example 1: Add a new log profile to export the activity log matching the location condition to a storage account
34+
```powershell
3535
Add-AzLogProfile -Location "Global","West US" -Name ExportLogProfile -StorageAccountId /subscriptions/40gpe80s-9sb7-4f07-9042-b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount
3636
```
3737

38+
### Example 2
39+
40+
Creates a new activity log profile. (autogenerated)
41+
42+
```powershell <!-- Aladdin Generated Example -->
43+
Add-AzLogProfile -Location 'Global' -Name ExportLogProfile -RetentionInDays <Int32> -ServiceBusRuleId <String> -StorageAccountId /subscriptions/40gpe80s-9sb7-4f07-9042-b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount
44+
```
45+
3846
## PARAMETERS
3947

4048
### -Category

src/Monitor/Monitor/help/Get-AzScheduledQueryRule.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Gets Scheduled Query Resources
3434

3535
## EXAMPLES
3636

37-
### Example 1 - List by subscription or resource group
37+
### Example 1: List by subscription or resource group
3838
```powershell
3939
PS C:\> Get-AzScheduledQueryRule -ResourceGroupName "MyResourceGroup"
4040
@@ -65,7 +65,7 @@ Location : centralindia
6565
Tags : {[hidden-link:/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}
6666
```
6767

68-
### Example 2 - Get by rule name
68+
### Example 2: Get by rule name
6969
```powershell
7070
PS C:\> Get-AzScheduledQueryRule -ResourceGroupName "MyResourceGroup" -Name "LogAlertRule1"
7171
@@ -83,7 +83,7 @@ Location : centralindia
8383
Tags : {[hidden-link:/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}
8484
```
8585

86-
### Example 3 - Get by resource Id
86+
### Example 3: Get by resource Id
8787
```powershell
8888
PS C:\> Get-AzScheduledQueryRule -ResourceId "/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1"
8989

src/Monitor/Monitor/help/New-AzAutoscaleRule.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The **New-AzAutoscaleRule** cmdlet creates an Autoscale rule.
2727
## EXAMPLES
2828

2929
### Example 1: Create a rule
30-
```
30+
```powershell
3131
PS C:\>$Rule = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
3232
MetricTrigger ScaleAction
3333
------------- -----------
@@ -37,7 +37,7 @@ Microsoft.Azure.Management.Insights.Models.MetricTrigger Microsoft.Azure.Mana
3737
This command creates a rule.
3838

3939
### Example 2: Create two rules
40-
```
40+
```powershell
4141
PS C:\>$Rule1 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
4242
4343
PS C:\> $Rule2 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:10:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "2"
@@ -50,6 +50,14 @@ Microsoft.Azure.Management.Insights.Models.MetricTrigger Microsoft.Azure.Mana
5050
The first command creates a rule for the Requests metric, and then stores it in the $Rule1 variable.
5151
The second command creates a second rule for the Requests metric, and then stores it in the $Rule2 variable.
5252

53+
### Example 3
54+
55+
Creates an Autoscale rule. (autogenerated)
56+
57+
```powershell <!-- Aladdin Generated Example -->
58+
New-AzAutoscaleRule -MetricName 'Requests' -MetricResourceId '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite' -MetricStatistic Average -Operator Equals -ScaleActionCooldown 00:05:00 -ScaleActionDirection None -ScaleActionScaleType ChangeCount -ScaleActionValue '1' -Threshold 10 -TimeGrain 00:01:00 -TimeWindow <TimeSpan>
59+
```
60+
5361
## PARAMETERS
5462

5563
### -DefaultProfile

src/Monitor/Monitor/help/New-AzAutoscaleWebhook.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ The **New-AzAutoscaleWebhook** cmdlet creates an Autoscale webhook.
2323

2424
## EXAMPLES
2525

26+
### Example 1
27+
28+
Creates an Autoscale webhook. (autogenerated)
29+
30+
```powershell <!-- Aladdin Generated Example -->
31+
New-AzAutoscaleWebhook -ServiceUri 'https://contoso.com'
32+
```
33+
2634
## PARAMETERS
2735

2836
### -DefaultProfile

src/Monitor/Monitor/help/New-AzMetricAlertRuleV2DimensionSelection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The **New-AzMetricAlertRuleV2DimensionSelection** cmdlet creates a local dimensi
2222

2323
## EXAMPLES
2424

25-
### Example 1 : Create a dimension selection object
25+
### Example 1: Create a dimension selection object
2626

2727
```powershell
2828
PS C:\> New-AzMetricAlertRuleV2DimensionSelection -DimensionName LUN -ValuesToInclude 1,3,4

src/Monitor/Monitor/help/New-AzScheduledQueryRuleSource.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ PS C:\> $source = New-AzScheduledQueryRuleSource -Query "Heartbeat | summarize A
3030
-QueryType "ResultCount"
3131
```
3232

33+
### Example 2
34+
35+
Creates an object of type Source. (autogenerated)
36+
37+
```powershell <!-- Aladdin Generated Example -->
38+
New-AzScheduledQueryRuleSource -DataSourceId <String> -Query 'Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)'
39+
```
40+
3341
## PARAMETERS
3442

3543
### -AuthorizedResource

src/Monitor/Monitor/help/Remove-AzAutoscaleSetting.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma
2525

2626
## EXAMPLES
2727

28+
### Example 1
29+
30+
Removes an Autoscale setting. (autogenerated)
31+
32+
```powershell <!-- Aladdin Generated Example -->
33+
Remove-AzAutoscaleSetting -Name 'LogAlertRule1' -ResourceGroupName MyResourceGroup
34+
```
35+
2836
## PARAMETERS
2937

3038
### -DefaultProfile

src/Monitor/Monitor/help/Remove-AzLogProfile.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma
2424

2525
## EXAMPLES
2626

27+
### Example 1
28+
29+
Removes a log profile. (autogenerated)
30+
31+
```powershell <!-- Aladdin Generated Example -->
32+
Remove-AzLogProfile -Name 'LogAlertRule1'
33+
```
34+
2735
## PARAMETERS
2836

2937
### -DefaultProfile

0 commit comments

Comments
 (0)