Skip to content

Commit 841d8b3

Browse files
aladdindockceiw
andauthored
Add new examples to Compute (#12257)
- Add new examples to the following modules: Compute Co-authored-by: Maoliang Huang <[email protected]>
1 parent 959f1f3 commit 841d8b3

17 files changed

+149
-13
lines changed

src/Compute/Compute/help/Disable-AzVmssDiskEncryption.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ Disables disk encryption on a VM scale set.
2424
## EXAMPLES
2525

2626
### Example 1
27-
```
27+
```powershell
2828
PS C:\> Disable-AzVmssDiskEncryption -ResourceGroupName "Group001" -VMScaleSetName "VMSS001"
2929
```
3030

3131
Disables disk encryption on the VM scale set named VMSS001 that belongs to the resource group named Group001.
3232

33+
### Example 2
34+
35+
Disables disk encryption on a VM scale set. (autogenerated)
36+
37+
```powershell <!-- Aladdin Generated Example -->
38+
Disable-AzVmssDiskEncryption -ResourceGroupName 'Group001' -VMScaleSetName 'VMSS001' -VolumeType OS
39+
```
40+
3341
## PARAMETERS
3442

3543
### -AsJob

src/Compute/Compute/help/Get-AzVMADDomainExtension.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ The **Get-AzVMADDomainExtension** cmdlet gets information about the specified Az
2323

2424
## EXAMPLES
2525

26+
### Example 1
27+
28+
Gets information about an AD domain extension. (autogenerated)
29+
30+
```powershell <!-- Aladdin Generated Example -->
31+
Get-AzVMADDomainExtension -Name 'AgentPool01' -ResourceGroupName myresourcegroup -VMName 'VM01'
32+
```
33+
2634
## PARAMETERS
2735

2836
### -DefaultProfile

src/Compute/Compute/help/Get-AzVMDiagnosticsExtension.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ The **Get-AzVMDiagnosticsExtension** cmdlet gets the settings of the Azure Diagn
2424
## EXAMPLES
2525

2626
### Example 1: Get the diagnostics extension applied to a virtual machine
27-
```
27+
```powershell
2828
PS C:\> Get-AzVMDiagnosticsExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM22"
2929
```
3030

3131
This command gets the diagnostics extension applied to the virtual machine named ContosoVM22.
3232

33+
### Example 2
34+
35+
Gets the settings of the Diagnostics extension on a virtual machine. (autogenerated)
36+
37+
```powershell <!-- Aladdin Generated Example -->
38+
Get-AzVMDiagnosticsExtension -Name 'AgentPool01' -ResourceGroupName 'ResourceGroup11' -Status -VMName 'ContosoVM22'
39+
```
40+
3341
## PARAMETERS
3442

3543
### -DefaultProfile

src/Compute/Compute/help/Get-AzVMDscExtensionStatus.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ When a configuration is applied this cmdlet produces output consistent with the
2424

2525
## EXAMPLES
2626

27+
### Example 1
28+
29+
Gets the status of the DSC extension handler for a virtual machine. (autogenerated)
30+
31+
```powershell <!-- Aladdin Generated Example -->
32+
Get-AzVMDscExtensionStatus -Name 'AgentPool01' -ResourceGroupName myresourcegroup -VMName 'VM01'
33+
```
34+
2735
## PARAMETERS
2836

2937
### -DefaultProfile

src/Compute/Compute/help/New-AzProximityPlacementGroup.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This cmdlet will create Proximity Placement Group resource.
2424
## EXAMPLES
2525

2626
### Example 1
27-
```
27+
```powershell
2828
PS C:\> New-AzureRmProximityPlacementGroup -ResourceGroupName $resourceGroupName -Name $proximityPlacementGroupName -Location $location -Tag @{key1 = "val1"}
2929
3030
ResourceGroupName : rg0
@@ -38,6 +38,14 @@ Tags : {"key1":"val1"}
3838

3939
This command creates a proximity place group in the given location.
4040

41+
### Example 2
42+
43+
Create Proximity Placement Group resource. (autogenerated)
44+
45+
```powershell <!-- Aladdin Generated Example -->
46+
New-AzProximityPlacementGroup -Location westus -Name 'AgentPool01' -ProximityPlacementGroupType <String> -ResourceGroupName myresourcegroup
47+
```
48+
4149
## PARAMETERS
4250

4351
### -AsJob

src/Compute/Compute/help/New-AzSnapshotConfig.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The **New-AzSnapshotConfig** cmdlet creates a configurable snapshot object.
2828
## EXAMPLES
2929

3030
### Example 1
31-
```
31+
```powershell
3232
PS C:\> $snapshotconfig = New-AzSnapshotConfig -Location 'Central US' -DiskSizeGB 5 -AccountType StandardLRS -OsType Windows -CreateOption Empty -EncryptionSettingsEnabled $true;
3333
PS C:\> $secretUrl = https://myvault.vault-int.azure-int.net/secrets/123/;
3434
PS C:\> $secretId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault123';
@@ -43,6 +43,14 @@ The first command creates a local empty snapshot object with size 5GB in Standar
4343
The second and third commands set the disk encryption key and key encryption key settings for the snapshot object.
4444
The last command takes the snapshot object and creates a snapshot with name 'Snapshot01' in resource group 'ResourceGroup01'.
4545

46+
### Example 2
47+
48+
Creates a configurable snapshot object. (autogenerated)
49+
50+
```powershell <!-- Aladdin Generated Example -->
51+
New-AzSnapshotConfig -CreateOption Empty -Location 'Central US' -SourceUri 'https://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd'
52+
```
53+
4654
## PARAMETERS
4755

4856
### -CreateOption

src/Compute/Compute/help/New-AzVMDataDisk.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The **New-AzVMDataDisk** cmdlet creates a local data disk object for a virtual m
3333
## EXAMPLES
3434

3535
### Example 1: Add a managed data disk to a Vmss VM.
36-
```
36+
```powershell
3737
PS C:\> $disk = Get-AzDisk -ResourceGroupName $rgname -DiskName $diskname0
3838
PS C:\> $datadisk = New-AzVMDataDisk -Caching 'ReadOnly' -Lun 2 -CreateOption Attach -StorageAccountType Standard_LRS -ManagedDiskId $disk.Id
3939
PS C:\> $VmssVM = Get-AzVmssVM -ResourceGroupName "myrg" -VMScaleSetName "myvmss" -InstanceId 0
@@ -45,6 +45,14 @@ The next command creates a data disk object with the managed disk.
4545
The next command gets an existing Vmss VM given by the resource group name, the vmss name and the instance ID.
4646
The final command updates the Vmss VM by adding a new data disk.
4747

48+
### Example 2
49+
50+
Creates a local data disk object for a virtual machine or a Vmss VM. (autogenerated)
51+
52+
```powershell <!-- Aladdin Generated Example -->
53+
New-AzVMDataDisk -Caching None -CreateOption Attach -DiskSizeInGB 1 -Lun 2 -Name 'AgentPool01'
54+
```
55+
4856
## PARAMETERS
4957

5058
### -Caching

src/Compute/Compute/help/New-AzVmssConfig.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ object. Other cmdlets are needed to configure the VMSS object. These cmdlets are
5858
## EXAMPLES
5959

6060
### Example 1: Create a VMSS configuration object
61-
```
61+
```powershell
6262
PS C:\> $VMSS = New-AzVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic" -NetworkInterfaceConfiguration $NetCfg `
6363
| Add-AzVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg `
6464
| Set-AzVmssOSProfile -ComputerNamePrefix "Test" -AdminUsername $adminUsername -AdminPassword $AdminPassword `
@@ -76,6 +76,14 @@ This example creates a VMSS configuration object. The first command uses the
7676
variable named $VMSS. The second command uses the **New-AzVmss** cmdlet to create a VMSS that
7777
uses the VMSS configuration object created in the first command.
7878

79+
### Example 2
80+
81+
Creates a VMSS configuration object. (autogenerated)
82+
83+
```powershell <!-- Aladdin Generated Example -->
84+
New-AzVmssConfig -Location <String> -Overprovision $false -SkuCapacity 2 -SkuName 'Standard_A0' -Tag 'Sql' -UpgradePolicyMode Automatic
85+
```
86+
7987
## PARAMETERS
8088

8189
### -AutomaticRepairGracePeriod

src/Compute/Compute/help/Remove-AzProximityPlacementGroup.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,20 @@ This cmdlet will delete Proximity Placement Group resource.
3636
## EXAMPLES
3737

3838
### Example 1
39-
```
39+
```powershell
4040
PS C:\> Get-AzureRmProximityPlacementGroup -ResourceGroupName $resourceGroupName -Name $proximityPlacementGroupName | Remove-AzureRmProximityPlacementGroup
4141
```
4242

4343
This command removes the given proximity placement group.
4444

45+
### Example 2
46+
47+
This command removes the given proximity placement group. (autogenerated)
48+
49+
```powershell <!-- Aladdin Generated Example -->
50+
Remove-AzProximityPlacementGroup -Name 'AgentPool01' -ResourceGroupName myresourcegroup
51+
```
52+
4553
## PARAMETERS
4654

4755
### -AsJob

src/Compute/Compute/help/Remove-AzVMAccessExtension.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ The **Remove-AzVMAccessExtension** cmdlet removes the Virtual Machine Access (VM
2323

2424
## EXAMPLES
2525

26+
### Example 1
27+
28+
Removes the VMAccess extension from a virtual machine. (autogenerated)
29+
30+
```powershell <!-- Aladdin Generated Example -->
31+
Remove-AzVMAccessExtension -Name 'AgentPool01' -ResourceGroupName myresourcegroup -VMName 'VM01'
32+
```
33+
2634
## PARAMETERS
2735

2836
### -DefaultProfile

src/Compute/Compute/help/Remove-AzVMCustomScriptExtension.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ The **Remove-AzVMCustomScriptExtension** cmdlet removes a custom script Virtual
2323

2424
## EXAMPLES
2525

26+
### Example 1
27+
28+
Removes a custom script extension from a virtual machine. (autogenerated)
29+
30+
```powershell <!-- Aladdin Generated Example -->
31+
Remove-AzVMCustomScriptExtension -Name 'AgentPool01' -ResourceGroupName myresourcegroup -VMName 'VM01'
32+
```
33+
2634
## PARAMETERS
2735

2836
### -DefaultProfile

src/Compute/Compute/help/Set-AzVMAccessExtension.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,21 @@ The **Set-AzVMAccessExtension** cmdlet adds the Virtual Machine Access (VMAccess
2626
## EXAMPLES
2727

2828
### Example 1: Add a VMAccess extension
29-
```
29+
```powershell
3030
PS C:\> Set-AzVMAccessExtension -ResourceGroupName "ResourceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "2.4" -UserName "PFuller" -Password "Password"
3131
```
3232

3333
This command adds a VMAccess extension for the virtual machine named VirtualMachine07 in ResourceGroup11.
3434
The command specifies the name and type handler version for VMAccess.
3535

36+
### Example 2
37+
38+
Adds the VMAccess extension to a virtual machine. (autogenerated)
39+
40+
```powershell <!-- Aladdin Generated Example -->
41+
Set-AzVMAccessExtension -Credential <PSCredential> -Location 'Central US' -Name 'ContosoTest' -ResourceGroupName 'ResourceGroup11' -TypeHandlerVersion '2.4' -VMName 'VirtualMachine07'
42+
```
43+
3644
## PARAMETERS
3745

3846
### -Credential

src/Compute/Compute/help/Set-AzVMCustomScriptExtension.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,21 @@ This extension lets you run your own scripts on the virtual machine.
8888
## EXAMPLES
8989

9090
### Example 1: Add a custom script
91-
```
91+
```powershell
9292
PS C:\> Set-AzVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "1.1" -StorageAccountName "Contoso" -StorageAccountKey <StorageKey> -FileName "ContosoScript.exe" -ContainerName "Scripts"
9393
```
9494

9595
This command adds a custom script to the virtual machine named VirtualMachine07.
9696
The script file is contososcript.exe.
9797

98+
### Example 2
99+
100+
Adds a custom script extension to a virtual machine. (autogenerated)
101+
102+
```powershell <!-- Aladdin Generated Example -->
103+
Set-AzVMCustomScriptExtension -Argument <String> -ContainerName 'Scripts' -DefaultProfile <IAzureContextContainer> -FileName 'ContosoScript.exe' -Location 'Central US' -Name 'ContosoTest' -ResourceGroupName 'ResourceGroup11' -Run 'myScript.ps1' -SecureExecution -StorageAccountKey <String> -StorageAccountName 'Contoso' -TypeHandlerVersion '1.1' -VMName 'VirtualMachine07'
104+
```
105+
98106
## PARAMETERS
99107

100108
### -Argument

src/Compute/Compute/help/Set-AzVMDataDisk.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The **Set-AzVMDataDisk** cmdlet modifies properties of a virtual machine data di
3333
## EXAMPLES
3434

3535
### Example 1: Modify the caching mode of a data disk
36-
```
36+
```powershell
3737
PS C:\> $VM = Get-AzVM -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM07"
3838
PS C:\> Set-AzVMDataDisk -VM $VM -Name "DataDisk01" -Caching ReadWrite | Update-AzVM
3939
```
@@ -44,6 +44,14 @@ The second command modifies the caching mode for the data disk named DataDisk01
4444
The command passes the result to the Update-AzVM cmdlet, which implements your changes.
4545
A change to the cashing mode causes the virtual machine to restart.
4646

47+
### Example 2
48+
49+
Modifies properties of a virtual machine data disk. (autogenerated)
50+
51+
```powershell <!-- Aladdin Generated Example -->
52+
Set-AzVMDataDisk -Caching None -Lun 1 -VM <PSVirtualMachine>
53+
```
54+
4755
## PARAMETERS
4856

4957
### -Caching

src/Compute/Compute/help/Set-AzVmss.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ The only action this cmdlet supports is Reimage.
4545
## EXAMPLES
4646

4747
### Example 1: Reimage a VMSS
48-
```
48+
```powershell
4949
PS C:\> Set-AzVmss -Reimage -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS"
5050
```
5151

5252
This command reimages the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup.
5353

54+
### Example 2
55+
56+
Sets specific actions on a specified VMSS. (autogenerated)
57+
58+
```powershell <!-- Aladdin Generated Example -->
59+
Set-AzVmss -ReimageAll -ResourceGroupName 'ContosoGroup' -VMScaleSetName 'ContosoVMSS'
60+
```
61+
5462
## PARAMETERS
5563

5664
### -AsJob

src/Compute/Compute/help/Set-AzVmssVM.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ The **Set-AzVmssVM** cmdlet modifies the state of a Virtual Machine Scale Set (V
5050

5151
## EXAMPLES
5252

53+
### Example 1
54+
55+
Modifies the state of a VMSS instance. (autogenerated)
56+
57+
```powershell <!-- Aladdin Generated Example -->
58+
Set-AzVmssVM -InstanceId <String> -Reimage -ResourceGroupName myresourcegroup -VMScaleSetName 'VMSS001'
59+
```
60+
5361
## PARAMETERS
5462

5563
### -AsJob

src/Compute/Compute/help/Update-AzVmssVM.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Updates the state of a Vmss VM. For now, the only allowed update is adding a ma
4040
## EXAMPLES
4141

4242
### Example 1: Add a managed data disk to a Vmss VM using New-AzVMDataDisk
43-
```
43+
```powershell
4444
PS C:\> $disk = Get-AzDisk -ResourceGroupName $rgname -DiskName $diskname0
4545
PS C:\> $datadisk = New-AzVMDataDisk -Caching 'ReadOnly' -Lun 2 -CreateOption Attach -StorageAccountType Standard_LRS -ManagedDiskId $disk.Id
4646
PS C:\> $VmssVM = Get-AzVmssVM -ResourceGroupName "myrg" -VMScaleSetName "myvmss" -InstanceId 0
@@ -53,7 +53,7 @@ The next command gets an existing Vmss VM given by the resource group name, the
5353
The final command updates the Vmss VM by adding a new data disk.
5454

5555
### Example 2: Add a managed data disk to a Vmss VM using Add-AzVMDataDisk
56-
```
56+
```powershell
5757
PS C:\> $disk = Get-AzDisk -ResourceGroupName $rgname -DiskName $diskname0
5858
PS C:\> $VmssVM = Get-AzVmssVM -ResourceGroupName "myrg" -VMScaleSetName "myvmss" -InstanceId 0
5959
PS C:\> $VmssVM = Add-AzVMDataDisk -VirtualMachineScaleSetVM $VmssVM -Lun 0 -DiskSizeInGB 10 -CreateOption Attach -StorageAccountType Standard_LRS -ManagedDiskId $disk.Id
@@ -65,6 +65,14 @@ The next command gets an existing Vmss VM given by the resource group name, the
6565
The next command adds the managed disk to the Vmss VM stored locally in $VmssVM.
6666
The final command updates the Vmss VM with added data disk.
6767

68+
### Example 3
69+
70+
Updates the state of a Vmss VM. (autogenerated)
71+
72+
```powershell <!-- Aladdin Generated Example -->
73+
Update-AzVmssVM -InstanceId 0 -ProtectFromScaleIn $false -ProtectFromScaleSetAction $false -ResourceGroupName 'myrg' -VMScaleSetName 'myvmss'
74+
```
75+
6876
## PARAMETERS
6977

7078
### -AsJob

0 commit comments

Comments
 (0)