Skip to content

Commit

Permalink
Aladdin generated examples for Accounts, KeyVault, Monitor, Storage (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
aladdindoc and kceiw authored Apr 16, 2020
1 parent 34d5f9c commit 401f1b1
Show file tree
Hide file tree
Showing 26 changed files with 162 additions and 58 deletions.
4 changes: 2 additions & 2 deletions src/Accounts/Accounts/help/Clear-AzContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Remove all Azure Credentials, account, and subscription information.

## EXAMPLES

### Clear global context
```
### Example 1: Clear global context
```powershell
PS C:\> Clear-AzContext -Scope CurrentUser
```

Expand Down
6 changes: 3 additions & 3 deletions src/Accounts/Accounts/help/Clear-AzDefault.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ the user depending on the switch parameters specified by the user.
## EXAMPLES

### Example 1
```
```powershell
PS C:\> Clear-AzDefault
```

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

### Example 1
```
### Example 2
```powershell
PS C:\> Clear-AzDefault -ResourceGroup
```

Expand Down
12 changes: 10 additions & 2 deletions src/Accounts/Accounts/help/Disable-AzContextAutosave.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ Turn off autosaving Azure credentials. Your login information will be forgotten

## EXAMPLES

### Disable autosaving the context
```
### Example 1: Disable autosaving the context
```powershell
PS C:\> Disable-AzContextAutosave
```

Disable autosave for the current user.

### Example 2

Turn off autosaving Azure credentials in this powershell session. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Disable-AzContextAutosave -Scope Process
```

## PARAMETERS

### -DefaultProfile
Expand Down
12 changes: 6 additions & 6 deletions src/Accounts/Accounts/help/Disconnect-AzAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ After executing this cmdlet, you will need to login again using Connect-AzAccoun

## EXAMPLES

### Logout of the current account
```
### Example 1: Logout of the current account
```powershell
PS C:\> Disconnect-AzAccount
```

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

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

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.

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

Expand Down
12 changes: 10 additions & 2 deletions src/Accounts/Accounts/help/Enable-AzContextAutosave.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ Allow the azure credential, account and subscription information to be saved and

## EXAMPLES

### Enable autosaving credentials for the current user
```
### Example 1: Enable autosaving credentials for the current user
```powershell
PS C:\> Enable-AzContextAutosave
```

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

### Example 2

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)

```powershell <!-- Aladdin Generated Example -->
Enable-AzContextAutosave -Scope Process
```

## PARAMETERS

### -DefaultProfile
Expand Down
6 changes: 3 additions & 3 deletions src/Accounts/Accounts/help/Enable-AzureRmAlias.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Enables AzureRm prefix aliases for Az modules. If -Module is specified, only mod
## EXAMPLES

### Example 1
```
```powershell
PS C:\> Enable-AzureRmAlias
```

Enables all AzureRm prefixes for the current PowerShell session.

### Example 1
```
### Example 2
```powershell
PS C:\> Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser
```

Expand Down
8 changes: 4 additions & 4 deletions src/Accounts/Accounts/help/Rename-AzContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ Rename an Azure context. By default contexts are named by user account and subs

## EXAMPLES

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

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
'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion.

### Rename a context using positional parameters
```
### Example 2: Rename a context using positional parameters
```powershell
PS C:\> Rename-AzContext "My context" "Work"
```

Expand Down
12 changes: 10 additions & 2 deletions src/Accounts/Accounts/help/Select-AzContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ selected context.

## EXAMPLES

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

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

### Example 2

Select a subscription and account to target in Azure PowerShell cmdlets in this powershell session. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Select-AzContext -Name TestEnvironment -Scope Process
```

## PARAMETERS

### -DefaultProfile
Expand Down
8 changes: 8 additions & 0 deletions src/KeyVault/KeyVault/help/New-AzKeyVaultCertificatePolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ Updated :

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

### Example 2

Creates an in-memory certificate policy object. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzKeyVaultCertificatePolicy -IssuerName 'Self' -KeyType RSA -RenewAtNumberOfDaysBeforeExpiry <Int32> -SecretContentType application/x-pkcs12 -SubjectName 'CN=contoso.com' -ValidityInMonths 6
```

## PARAMETERS

### -CertificateTransparency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Storage Account.

## EXAMPLES

### Example 1 : Set an account-type SAS definition, and obtain a current SAS token based on it
### Example 1: Set an account-type SAS definition, and obtain a current SAS token based on it
```powershell
PS C:\> $sa = Get-AzStorageAccount -Name mysa -ResourceGroupName myrg
PS C:\> $kv = Get-AzKeyVault -VaultName mykv
Expand Down
8 changes: 8 additions & 0 deletions src/KeyVault/KeyVault/help/Update-AzKeyVaultCertificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ Updated : 8/1/2016 5:37:48 PM
The first command assigns an array of key/value pairs to the $Tags variable.
The second command sets the tags value of the certificate named TestCert01 to be $Tags.

### Example 2

Modifies editable attributes of a certificate. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Update-AzKeyVaultCertificate -Enable $true -Name 'TestCert01' -VaultName 'ContosoKV01'
```

## PARAMETERS

### -DefaultProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Tags :
Updates the Key Vault managed Azure Storage Account active key to 'key2'. 'key2' will be used to
generate SAS tokens after this update.

### Example 2

Update editable attributes of a Key Vault managed Azure Storage Account. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Update-AzKeyVaultManagedStorageAccount -AccountName 'mystorageaccount' -AutoRegenerateKey $false -RegenerationPeriod $regenerationPeriod -VaultName 'myvault'
```

## PARAMETERS

### -AccountName
Expand Down
8 changes: 8 additions & 0 deletions src/KeyVault/KeyVault/help/Update-AzKeyVaultNetworkRuleSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ Tags :

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.

### Example 2

Updates the network rule set on a key vault. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Update-AzKeyVaultNetworkRuleSet -DefaultAction Allow -VaultName 'myVault'
```

## PARAMETERS

### -Bypass
Expand Down
12 changes: 10 additions & 2 deletions src/Monitor/Monitor/help/Add-AzLogProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma

## EXAMPLES

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

### Example 2

Creates a new activity log profile. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Add-AzLogProfile -Location 'Global' -Name ExportLogProfile -RetentionInDays <Int32> -ServiceBusRuleId <String> -StorageAccountId /subscriptions/40gpe80s-9sb7-4f07-9042-b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount
```

## PARAMETERS

### -Category
Expand Down
6 changes: 3 additions & 3 deletions src/Monitor/Monitor/help/Get-AzScheduledQueryRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gets Scheduled Query Resources

## EXAMPLES

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

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

### Example 3 - Get by resource Id
### Example 3: Get by resource Id
```powershell
PS C:\> Get-AzScheduledQueryRule -ResourceId "/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1"
Expand Down
12 changes: 10 additions & 2 deletions src/Monitor/Monitor/help/New-AzAutoscaleRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The **New-AzAutoscaleRule** cmdlet creates an Autoscale rule.
## EXAMPLES

### Example 1: Create a rule
```
```powershell
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"
MetricTrigger ScaleAction
------------- -----------
Expand All @@ -37,7 +37,7 @@ Microsoft.Azure.Management.Insights.Models.MetricTrigger Microsoft.Azure.Mana
This command creates a rule.

### Example 2: Create two rules
```
```powershell
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"
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"
Expand All @@ -50,6 +50,14 @@ Microsoft.Azure.Management.Insights.Models.MetricTrigger Microsoft.Azure.Mana
The first command creates a rule for the Requests metric, and then stores it in the $Rule1 variable.
The second command creates a second rule for the Requests metric, and then stores it in the $Rule2 variable.

### Example 3

Creates an Autoscale rule. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
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>
```

## PARAMETERS

### -DefaultProfile
Expand Down
8 changes: 8 additions & 0 deletions src/Monitor/Monitor/help/New-AzAutoscaleWebhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ The **New-AzAutoscaleWebhook** cmdlet creates an Autoscale webhook.

## EXAMPLES

### Example 1

Creates an Autoscale webhook. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzAutoscaleWebhook -ServiceUri 'https://contoso.com'
```

## PARAMETERS

### -DefaultProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The **New-AzMetricAlertRuleV2DimensionSelection** cmdlet creates a local dimensi

## EXAMPLES

### Example 1 : Create a dimension selection object
### Example 1: Create a dimension selection object

```powershell
PS C:\> New-AzMetricAlertRuleV2DimensionSelection -DimensionName LUN -ValuesToInclude 1,3,4
Expand Down
8 changes: 8 additions & 0 deletions src/Monitor/Monitor/help/New-AzScheduledQueryRuleSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ PS C:\> $source = New-AzScheduledQueryRuleSource -Query "Heartbeat | summarize A
-QueryType "ResultCount"
```

### Example 2

Creates an object of type Source. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzScheduledQueryRuleSource -DataSourceId <String> -Query 'Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)'
```

## PARAMETERS

### -AuthorizedResource
Expand Down
8 changes: 8 additions & 0 deletions src/Monitor/Monitor/help/Remove-AzAutoscaleSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma

## EXAMPLES

### Example 1

Removes an Autoscale setting. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Remove-AzAutoscaleSetting -Name 'LogAlertRule1' -ResourceGroupName MyResourceGroup
```

## PARAMETERS

### -DefaultProfile
Expand Down
8 changes: 8 additions & 0 deletions src/Monitor/Monitor/help/Remove-AzLogProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma

## EXAMPLES

### Example 1

Removes a log profile. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Remove-AzLogProfile -Name 'LogAlertRule1'
```

## PARAMETERS

### -DefaultProfile
Expand Down
Loading

0 comments on commit 401f1b1

Please sign in to comment.