diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/RunnerTests.cs b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/RunnerTests.cs index a3237e74d607..55efacea36a0 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/RunnerTests.cs +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/RunnerTests.cs @@ -25,28 +25,6 @@ public void ExecuteRunnerTests() return; } - Assert.False(string.IsNullOrEmpty(csmAuth)); - Assert.True(csmAuth.Contains("AADTenant")); - - var envDictionary = TestUtilities.ParseConnectionString(csmAuth); - var testEnv = new TestEnvironment(envDictionary); - Assert.NotNull(testEnv.Tenant); - Assert.NotNull(testEnv.SubscriptionId); - Assert.NotNull(testEnv.ClientId); - Assert.True(envDictionary.ContainsKey("ApplicationSecret")); - - var authenticationContext = new AuthenticationContext("https://login.windows.net/" + testEnv.Tenant); - var credential = new ClientCredential(testEnv.ClientId, envDictionary["ApplicationSecret"]); - - var result = authenticationContext.AcquireToken("https://management.core.windows.net/", clientCredential: credential); - - Assert.NotNull(result.AccessToken); - envDictionary["RawToken"] = result.AccessToken; - - FixCSMAuthEnvVariable(envDictionary); - - Console.WriteLine(Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION")); - var testFile = File.ReadAllLines("ScenarioTests\\RunnerTests.csv"); foreach (var line in testFile) { diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs index ab706034b620..13ccb99292a3 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.cs @@ -19,6 +19,8 @@ namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests { public partial class VMDynamicTests { + public VMDynamicTests() { } + public VMDynamicTests(Xunit.Abstractions.ITestOutputHelper output) { ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.ps1 b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.ps1 index 86f06761afdb..49232b4d6805 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.ps1 +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VMDynamicTests.ps1 @@ -14,25 +14,26 @@ function get_all_vm_locations { - if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) - { - $namespace = "Microsoft.Compute" - $type = "virtualMachines" - $location = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type} + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) + { + $namespace = "Microsoft.Compute" + $type = "virtualMachines" + $location = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type} - if ($location -eq $null) - { - $st = Write-Verbose 'Getting all Azure location - End'; - return @("West US", "East US") - } else - { - $st = Write-Verbose 'Getting all Azure location - End'; - return $location.Locations - } - } + if ($location -eq $null) + { + $st = Write-Verbose 'Getting all Azure location - End'; + return @("West US", "East US") + } + else + { + $st = Write-Verbose 'Getting all Azure location - End'; + return $location.Locations + } + } $st = Write-Verbose 'Getting all Azure location - End'; - return @("West US", "East US") + return @("West US", "East US") } function get_all_standard_vm_sizes @@ -336,7 +337,14 @@ function Run-VMDynamicTests $st = (func_create_and_setup_nic_ids $random_seed) | Out-File -Encoding ASCII -Append -FilePath $generated_file_name -Force; $st = $func_create_and_setup_vm_config_object | Out-File -Encoding ASCII -Append -FilePath $generated_file_name -Force; - $loc_name_str = $locations[$i % $locations.Count]; + if ($locations.Count -eq 1) + { + $loc_name_str = $locations + } + else + { + $loc_name_str = $locations[$i % $locations.Count]; + } if ($target_location -ne $null -and $target_location -ne '') { diff --git a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml index 7f44a860dfad..6486b61ef924 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml +++ b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml @@ -1,9965 +1,326 @@ - - - - - Add-AzureRmContainerServiceAgentPoolProfile - - Add container service agent pool profile - - - - - Add - AzureRmContainerServiceAgentPoolProfile - - - - This cmdlet allows you to add the a container service agent pool profile to the container service local object. - - - - Add-AzureRmContainerServiceAgentPoolProfile - - ContainerService - - Container service object to add the agent pool profile to. You can create this object with the New-AzureRmContainerServiceConfig cmdlet. - - ContainerService - - - Name - - Unique name of the agent pool profile within the context of the subscription and resource group. - - String - - - Count - - Number of agents that will host containers. Allowed values should be within the range of 1 to 100 (inclusive). Default value is 1. - - Nullable`1[Int32] - - - VmSize - - Size of the virtual machines for the agents. - - String - - - DnsPrefix - - DNS prefix to be used to create fqdn for this agent pool. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ContainerService - - Container service object to add the agent pool profile to. You can create this object with the New-AzureRmContainerServiceConfig cmdlet. - - ContainerService - - ContainerService - - - - - - Name - - Unique name of the agent pool profile within the context of the subscription and resource group. - - String - - String - - - - - - Count - - Number of agents that will host containers. Allowed values should be within the range of 1 to 100 (inclusive). Default value is 1. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - VmSize - - Size of the virtual machines for the agents. - - String - - String - - - - - - DnsPrefix - - DNS prefix to be used to create fqdn for this agent pool. - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Add-AzureRmContainerServiceAgentPoolProfile -Name $agentPoolProfileName -VmSize $vmSize -DnsPrefix $agentPoolDnsPrefixName - - - - - - - - - - - - - - - - - - - - - - Add-AzureRmVhd - - Uploads a virtual hard disk from an on-premises virtual machine to a blob in a cloud storage account in Azure. - - - - - Add - AzureRmVhd - - - - The Add-AzureRmVhd cmdlet uploads on-premises virtual hard disks, in .vhd file format, to a blob storage account as fixed virtual hard disks. You can configure the number of uploader threads that will be used or overwrite an existing blob in the specified destination URI. Also supported is the ability to upload a patched version of an on-premises .vhd file. When a base virtual hard disk has already been uploaded, you can upload differencing disks that use the base image as the parent. Shared access signature (SAS) URI is supported also. - - - - Add-AzureRmVhd - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - Destination - - Specifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI. - - Uri - - - LocalFilePath - - Specifies the path of the local .vhd file. - - FileInfo - - - NumberOfUploaderThreads - - Specifies the number of uploader threads to be used when uploading the .vhd file. - - Nullable`1[Int32] - - - BaseImageUriToPatch - - Specifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter. - - Uri - - - OverWrite - - Indicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - Destination - - Specifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI. - - Uri - - Uri - - - none - - - LocalFilePath - - Specifies the path of the local .vhd file. - - FileInfo - - FileInfo - - - none - - - NumberOfUploaderThreads - - Specifies the number of uploader threads to be used when uploading the .vhd file. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - BaseImageUriToPatch - - Specifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter. - - Uri - - Uri - - - none - - - OverWrite - - Indicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a VHD file -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" - - This command adds a .vhd file to a storage account. - - - - - - - - - - - - - - -------------------------- Example 2: Add a VHD file and overwrite the destination -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -Overwrite - - This command adds a .vhd file to a storage account. The command overwrites an existing file. - - - - - - - - - - - - - - -------------------------- Example 3: Add a VHD file and specify the number of threads -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32 - - This command adds a .vhd file to a storage account. The command specifies the number of threads to use to upload the file. - - - - - - - - - - - - - - -------------------------- Example 4: Add a VHD file and specify the SAS URI -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd?st=2013-01 -09T22%3A15%3A49Z&amp;se=2013-01-09T23%3A10%3A49Z&amp;sr=b&amp;sp=w&amp;sig=13T9Ow%2FRJAMmhfO%2FaP3HhKKJ6AY093SmveO SIV4%2FR7w%3D" -LocalFilePath "C:\vhd\win7baseimage.vhd" - - This command adds a .vhd file to a storage account and specifies the SAS URI. - - - - - - - - - - - - - - - - Save-AzureRmVhd - - - - - - - - Add-AzureRmVMAdditionalUnattendContent - - Adds information to the unattended Windows Setup answer file. - - - - - Add - AzureRmVMAdditionalUnattendContent - - - - The Add-AzureRmVMAdditionalUnattendContent cmdlet adds information to the unattended Windows Setup answer file. Specify additional base 64 encoded .xml formatted information that this cmdlet adds to the unattend.xml file. - - - - Add-AzureRmVMAdditionalUnattendContent - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - - Content - - Specifies base 64 encoded XML formatted content. This cmdlet adds the content to the unattend.xml file. The XML content must be less than 4 KB and must include the root element for the setting or feature that this cmdlet inserts. - - String - - - SettingName - - Specifies the name of the setting to which the content applies. The acceptable values for this parameter are: - -- FirstLogonCommands --- AutoLogon - - Nullable`1[SettingNames] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Content - - Specifies base 64 encoded XML formatted content. This cmdlet adds the content to the unattend.xml file. The XML content must be less than 4 KB and must include the root element for the setting or feature that this cmdlet inserts. - - String - - String - - - none - - - SettingName - - Specifies the name of the setting to which the content applies. The acceptable values for this parameter are: - -- FirstLogonCommands --- AutoLogon - - Nullable`1[SettingNames] - - Nullable`1[SettingNames] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add content to unattend.xml -------------------------- - - PS C:\> - - PS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id + + + +Add-AzureRmContainerServiceAgentPoolProfileAdds a container service agent pool profile.AddAzureRmContainerServiceAgentPoolProfileThe Add-AzureRmContainerServiceAgentPoolProfile cmdlet adds a container service agent pool profile to a local container service object.Add-AzureRmContainerServiceAgentPoolProfileContainerServiceSpecifies the container service object to which this cmdlet adds an agent pool profile. To obtain a ContainerService object, use the New-AzureRmContainerServiceConfig cmdlet. ContainerServiceNameSpecifies the name of the agent pool profile. This value must be unique in the context of the subscription and resource group.StringCountSpecifies the number of agents that host containers. The acceptable values for this parameter are: integers from 1 to 100. The default value is 1.Int32]VmSizeSpecifies the size of the virtual machines for the agents.StringDnsPrefixSpecifies the DNS prefix that this cmdlet uses to create the fully qualified domain name for this agent pool.StringContainerServiceSpecifies the container service object to which this cmdlet adds an agent pool profile. To obtain a ContainerService object, use the New-AzureRmContainerServiceConfig cmdlet. ContainerServiceContainerServicenoneCountSpecifies the number of agents that host containers. The acceptable values for this parameter are: integers from 1 to 100. The default value is 1.Int32]Int32]noneDnsPrefixSpecifies the DNS prefix that this cmdlet uses to create the fully qualified domain name for this agent pool.StringStringnoneNameSpecifies the name of the agent pool profile. This value must be unique in the context of the subscription and resource group.StringStringnoneVmSizeSpecifies the size of the virtual machines for the agents.StringStringnoneExample 1: Add a profilePS C:\>Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" +This command adds a container service agent pool profile to the local container service object.New-AzureRmContainerServiceConfigRemove-AzureRmContainerServiceAgentPoolProfileAdd-AzureRMVhdUploads a virtual hard disk from an on-premises virtual machine to a blob in a cloud storage account in Azure.AddAzureRMVhdThe Add-AzureRmVhd cmdlet uploads on-premises virtual hard disks, in .vhd file format, to a blob storage account as fixed virtual hard disks. You can configure the number of uploader threads that will be used or overwrite an existing blob in the specified destination URI. Also supported is the ability to upload a patched version of an on-premises .vhd file. When a base virtual hard disk has already been uploaded, you can upload differencing disks that use the base image as the parent. Shared access signature (SAS) URI is supported also.Add-AzureRMVhdResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringDestinationSpecifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI.UriLocalFilePathSpecifies the path of the local .vhd file.FileInfoNumberOfUploaderThreadsSpecifies the number of uploader threads to be used when uploading the .vhd file.Int32]BaseImageUriToPatchSpecifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter.UriOverWriteIndicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists.BaseImageUriToPatchSpecifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter.UriUrinoneDestinationSpecifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI.UriUrinoneLocalFilePathSpecifies the path of the local .vhd file.FileInfoFileInfononeNumberOfUploaderThreadsSpecifies the number of uploader threads to be used when uploading the .vhd file.Int32]Int32]noneOverWriteIndicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneExample 1: Add a VHD filePS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" +This command adds a .vhd file to a storage account.Example 2: Add a VHD file and overwrite the destinationPS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -Overwrite +This command adds a .vhd file to a storage account. The command overwrites an existing file.Example 3: Add a VHD file and specify the number of threadsPS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32 +This command adds a .vhd file to a storage account. The command specifies the number of threads to use to upload the file.Example 4: Add a VHD file and specify the SAS URIPS C:\>Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd?st=2013-01 -09T22%3A15%3A49Z&amp;se=2013-01-09T23%3A10%3A49Z&amp;sr=b&amp;sp=w&amp;sig=13T9Ow%2FRJAMmhfO%2FaP3HhKKJ6AY093SmveO SIV4%2FR7w%3D" -LocalFilePath "C:\vhd\win7baseimage.vhd" +This command adds a .vhd file to a storage account and specifies the SAS URI.Save-AzureRmVhdAdd-AzureRmVMAdditionalUnattendContentAdds information to the unattended Windows Setup answer file.AddAzureRmVMAdditionalUnattendContentThe Add-AzureRmVMAdditionalUnattendContent cmdlet adds information to the unattended Windows Setup answer file. Specify additional base 64 encoded .xml formatted information that this cmdlet adds to the unattend.xml file.Add-AzureRmVMAdditionalUnattendContentVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. PSVirtualMachineContentSpecifies base 64 encoded XML formatted content. This cmdlet adds the content to the unattend.xml file. The XML content must be less than 4 KB and must include the root element for the setting or feature that this cmdlet inserts.StringSettingNameSpecifies the name of the setting to which the content applies. The acceptable values for this parameter are: + +-- FirstLogonCommands +-- AutoLogonSettingNames]ContentSpecifies base 64 encoded XML formatted content. This cmdlet adds the content to the unattend.xml file. The XML content must be less than 4 KB and must include the root element for the setting or feature that this cmdlet inserts.StringStringnoneSettingNameSpecifies the name of the setting to which the content applies. The acceptable values for this parameter are: + +-- FirstLogonCommands +-- AutoLogonSettingNames]SettingNames]noneVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. PSVirtualMachinePSVirtualMachinenoneExample 1: Add content to unattend.xmlPS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id PS C:\> $Credential = Get-Credential -PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName "Contoso26" -Credential $Credential -PS C:\> $AucContent = "<UserAccounts><AdministratorPassword><Value>" + "Password" + "</Value><PlainText>true</PlainText></AdministratorPassword></UserAccounts>"; -PS C:\> $VirtualMachine = Add-AzureRmVMAdditionalUnattendContent -VM $VirtualMachine -Content $AucContent -SettingName "AutoLogon" - - The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. - - - The fourth command uses the Set-AzureRmVMOperatingSystem cmdlet to configure the virtual machine stored in $VirtualMachine. - - - - - - - - - - - - - Get-AzureRmAvailabilitySet - - - - Set-AzureRmVMOperatingSystem - - - - New-AzureRmVMConfig - - - - - - - - Add-AzureRmVMDataDisk - - Adds a data disk to a virtual machine. - - - - - Add - AzureRmVMDataDisk - - - - The Add-AzureRmVMDataDisk cmdlet adds a data disk to a virtual machine. You can add a data disk when you create a virtual machine, or you can add a data disk to an existing virtual machine. - - - - Add-AzureRmVMDataDisk - - VM - - Specifies the local virtual machine object to which to add a data disk. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - - Name - - Specifies the name of the data disk to add. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) for the virtual hard disk (VHD) file to create when a platform image or user image is used. This cmdlet copies the image binary large object (blob) to this location. This is the location from which to start the virtual machine. - - String - - - Caching - - Specifies the caching mode of the disk. The acceptable values for this parameter are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing this value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - CachingTypes - - - DiskSizeInGB - - Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. - - Nullable`1[Int32] - - - Lun - - Specifies the logical unit number (LUN) for a data disk. - - Nullable`1[Int32] - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. The acceptable values for this parameter are: - -- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. The VhdUri is all that is needed in order to tell the Azure platform the location of the virtual hard disk (VHD) to attach as a data disk to the virtual machine. +PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName "Contoso26" -Credential $Credential +PS C:\> $AucContent = "<UserAccounts><AdministratorPassword><Value>" + "Password" + "</Value><PlainText>true</PlainText></AdministratorPassword></UserAccounts>"; +PS C:\> $VirtualMachine = Add-AzureRmVMAdditionalUnattendContent -VM $VirtualMachine -Content $AucContent -SettingName "AutoLogon" +The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The third command creates a credential object by using the Get-Credential cmdlet, and then stores the result in the $Credential variable. The command prompts you for a user name and password. For more information, type Get-Help Get-Credential. The fourth command uses the Set-AzureRmVMOperatingSystem cmdlet to configure the virtual machine stored in $VirtualMachine. The fifth command assigns content to the $AucContent variable. The content includes a password. The final command adds the content stored in $AucContent to the unattend.xml file.Get-AzureRmAvailabilitySetSet-AzureRmVMOperatingSystemNew-AzureRmVMConfigAdd-AzureRmVMDataDiskAdds a data disk to a virtual machine. AddAzureRmVMDataDiskThe Add-AzureRmVMDataDisk cmdlet adds a data disk to a virtual machine. You can add a data disk when you create a virtual machine, or you can add a data disk to an existing virtual machine.Add-AzureRmVMDataDiskVMSpecifies the local virtual machine object to which to add a data disk. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object.PSVirtualMachineNameSpecifies the name of the data disk to add.StringVhdUriSpecifies the Uniform Resource Identifier (URI) for the virtual hard disk (VHD) file to create when a platform image or user image is used. This cmdlet copies the image binary large object (blob) to this location. This is the location from which to start the virtual machine.StringCachingSpecifies the caching mode of the disk. The acceptable values for this parameter are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing this value causes the virtual machine to restart.This setting affects the consistency and performance of the disk. ReadOnlyReadWriteNoneDiskSizeInGBSpecifies the size, in gigabytes, of an empty disk to attach to a virtual machine.Int32]LunSpecifies the logical unit number (LUN) for a data disk. Int32]CreateOptionSpecifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. The acceptable values for this parameter are: + +-- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. The VhdUri is all that is needed in order to tell the Azure platform the location of the virtual hard disk (VHD) to attach as a data disk to the virtual machine. -- Empty. Specify this to create an empty data disk. --- FromImage. Specify this option to create a virtual machine from a generalized image or disk. When you specify this option, you must specify the SourceImageUri parameter also in order to tell the Azure platform the location of the VHD to attach as a data disk. The VhdUri parameter is used as the location identifying where the data disk VHD will be stored when it is used by the virtual machine. - - DiskCreateOptionTypes - - - SourceImageUri - - Specifies the source URI of the disk that this cmdlet attaches. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object to which to add a data disk. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Name - - Specifies the name of the data disk to add. - - String - - String - - - none - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) for the virtual hard disk (VHD) file to create when a platform image or user image is used. This cmdlet copies the image binary large object (blob) to this location. This is the location from which to start the virtual machine. - - String - - String - - - none - - - Caching - - Specifies the caching mode of the disk. The acceptable values for this parameter are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing this value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - CachingTypes - - CachingTypes - - - none - - - DiskSizeInGB - - Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - Lun - - Specifies the logical unit number (LUN) for a data disk. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. The acceptable values for this parameter are: - -- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. The VhdUri is all that is needed in order to tell the Azure platform the location of the virtual hard disk (VHD) to attach as a data disk to the virtual machine. +-- FromImage. Specify this option to create a virtual machine from a generalized image or disk. When you specify this option, you must specify the SourceImageUri parameter also in order to tell the Azure platform the location of the VHD to attach as a data disk. The VhdUri parameter is used as the location identifying where the data disk VHD will be stored when it is used by the virtual machine.FromImageEmptyAttachSourceImageUriSpecifies the source URI of the disk that this cmdlet attaches. StringCachingSpecifies the caching mode of the disk. The acceptable values for this parameter are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing this value causes the virtual machine to restart.This setting affects the consistency and performance of the disk. CachingTypesCachingTypesnoneCreateOptionSpecifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. The acceptable values for this parameter are: + +-- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. The VhdUri is all that is needed in order to tell the Azure platform the location of the virtual hard disk (VHD) to attach as a data disk to the virtual machine. -- Empty. Specify this to create an empty data disk. --- FromImage. Specify this option to create a virtual machine from a generalized image or disk. When you specify this option, you must specify the SourceImageUri parameter also in order to tell the Azure platform the location of the VHD to attach as a data disk. The VhdUri parameter is used as the location identifying where the data disk VHD will be stored when it is used by the virtual machine. - - DiskCreateOptionTypes - - DiskCreateOptionTypes - - - none - - - SourceImageUri - - Specifies the source URI of the disk that this cmdlet attaches. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add data disks to a new virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -PS C:\> $DataDiskVhdUri01 = "https://contoso.blob.core.windows.net/test/data1.vhd" -PS C:\> $DataDiskVhdUri02 = "https://contoso.blob.core.windows.net/test/data2.vhd" -PS C:\> $DataDiskVhdUri03 = "https://contoso.blob.core.windows.net/test/data3.vhd" -PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $DataDiskVhdUri1 -CreateOption Empty -PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $DataDiskVhdUri2 -CreateOption Empty -PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk3' -Caching 'ReadOnly' -DiskSizeInGB 12 -Lun 2 -VhdUri $DataDiskVhdUri3 -CreateOption Empty - - The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 2: Add a data disk to an existing virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -PS C:\> Add-AzureRmVMDataDisk -VM $VirtualMachine -Name "disk1" -VhdUri "https://contoso.blob.core.windows.net/vhds/diskstandard03.vhd" -LUN 0 -Caching ReadOnly -DiskSizeinGB 1 -CreateOption Empty -PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine - - The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. - - - - - - - - - - - - - - -------------------------- Example 3: Add a data disk to a new virtual machine from a generalized user image -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -PS C:\> $DataImageUri = "https://contoso.blob.core.windows.net/system/Microsoft.Compute/Images/captured/dataimage.vhd" -PS C:\> $DataDiskUri = "https://contoso.blob.core.windows.net/test/datadisk.vhd" -PS C:\> $VirtualMachine = Add-AzureVMDataDisk -VM $VirtualMachine -Name "disk1" -SourceImageUri $DataImageUri -VhdUri $DataDiskUri -Lun 0 -CreateOption FromImage - - The first command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 4: Add data disks to a new virtual machine from a specialized user image -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -PS C:\> $DataDiskUri = "https://contoso.blob.core.windows.net/test/datadisk.vhd" -PS C:\> $VirtualMachine = Add-AzureVMDataDisk -VM $VirtualMachine -Name "dd1" -VhdUri $DataDiskUri -Lun 0 -CreateOption Attach - - The first command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. - - - - - - - - - - - - - - - - Remove-AzureRmVMDataDisk - - - - Get-AzureRmVM - - - - New-AzureRmVMConfig - - - - - - - - Add-AzureRmVMNetworkInterface - - Adds a network interface to a virtual machine. - - - - - Add - AzureRmVMNetworkInterface - - - - The Add-AzureRmVMNetworkInterface cmdlet adds a network interface to a virtual machine. You can add an interface when you create a virtual machine or add one to an existing virtual machine. - - - - Add-AzureRmVMNetworkInterface - - VM - - Specifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Id - - Specifies the ID of a network interface to add to a virtual machine. You can use the Get-AzureRmNetworkInterface cmdlet to obtain a network interface. - - String - - - Primary - - Indicates that this cmdlet adds the network interface as the primary interface. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Add-AzureRmVMNetworkInterface - - VM - - Specifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - NetworkInterface - - Specifies the network interface. - - List`1[PSNetworkInterface] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Id - - Specifies the ID of a network interface to add to a virtual machine. You can use the Get-AzureRmNetworkInterface cmdlet to obtain a network interface. - - String - - String - - - none - - - Primary - - Indicates that this cmdlet adds the network interface as the primary interface. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - NetworkInterface - - Specifies the network interface. - - List`1[PSNetworkInterface] - - List`1[PSNetworkInterface] - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a network interface to a new virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -PS C:\> Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id "/subscriptions/46fc8ea4-2de6-4179-8ab1-365da4121af4/resourceGroups/contoso/providers/Microsoft.Network/networkInterfaces/sshNIC" - - The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 2: Add a network interface to an existing virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -PS C:\> Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id "/subscriptions/46fc8ea4-2de6-4179-8ab1-365da4121af4/resourceGroups/contoso/providers/Microsoft.Network/networkInterfaces/sshNIC" -PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine - - The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. - - - - - - - - - - - - - - - - New-AzureRmVMConfig - - - - Get-AzureRmVM - - - - Get-AzureRmAvailabilitySet - - - - - - - - Add-AzureRmVMSecret - - Adds a secret to a virtual machine. - - - - - Add - AzureRmVMSecret - - - - The Add-AzureRmVMSecret cmdlet adds a secret to a virtual machine. This value lets you add a certificate to the virtual machine. The secret must be stored in a Key Vault. For more information about Key Vault, see What is Azure Key Vault? (https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/). For more information about the cmdlets, see Azure Key Vault Cmdlets (https://msdn.microsoft.com/library/azure/dn868052.aspx) in the Microsoft Developer Network library or the Set-AzureKeyVaultSecret cmdlet. - - - - Add-AzureRmVMSecret - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - - SourceVaultId - - Specifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for SourceVaultId when you add multiple certificates from the same Key Vault. - - String - - - CertificateStore - - Specifies the name of a certificate store on the virtual machine that runs the Windows operating system. This cmdlet adds the certificate to the store that this parameter specifies. You can only specify this parameter for virtual machines that run the Windows operating system. - - String - - - CertificateUrl - - Specifies the URL that points to a Key Vault secret which contains a certificate. - The certificate is the Base64 encoding of the following JavaScript Object Notation (JSON) object, which is encoded in UTF-8: - { -"data": "<Base64-encoded-file>", -"dataType": "<file-format>", -"password": "<pfx-file-password>" -} - Currently, dataType accepts only .pfx files. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - SourceVaultId - - Specifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for SourceVaultId when you add multiple certificates from the same Key Vault. - - String - - String - - - none - - - CertificateStore - - Specifies the name of a certificate store on the virtual machine that runs the Windows operating system. This cmdlet adds the certificate to the store that this parameter specifies. You can only specify this parameter for virtual machines that run the Windows operating system. - - String - - String - - - none - - - CertificateUrl - - Specifies the URL that points to a Key Vault secret which contains a certificate. - The certificate is the Base64 encoding of the following JavaScript Object Notation (JSON) object, which is encoded in UTF-8: - { -"data": "<Base64-encoded-file>", -"dataType": "<file-format>", -"password": "<pfx-file-password>" -} - Currently, dataType accepts only .pfx files. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a secret to a virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +-- FromImage. Specify this option to create a virtual machine from a generalized image or disk. When you specify this option, you must specify the SourceImageUri parameter also in order to tell the Azure platform the location of the VHD to attach as a data disk. The VhdUri parameter is used as the location identifying where the data disk VHD will be stored when it is used by the virtual machine.DiskCreateOptionTypesDiskCreateOptionTypesnoneDiskSizeInGBSpecifies the size, in gigabytes, of an empty disk to attach to a virtual machine.Int32]Int32]noneLunSpecifies the logical unit number (LUN) for a data disk. Int32]Int32]noneNameSpecifies the name of the data disk to add.StringStringnoneSourceImageUriSpecifies the source URI of the disk that this cmdlet attaches. StringStringnoneVhdUriSpecifies the Uniform Resource Identifier (URI) for the virtual hard disk (VHD) file to create when a platform image or user image is used. This cmdlet copies the image binary large object (blob) to this location. This is the location from which to start the virtual machine.StringStringnoneVMSpecifies the local virtual machine object to which to add a data disk. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object.PSVirtualMachinePSVirtualMachinenoneExample 1: Add data disks to a new virtual machine PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" +PS C:\> $DataDiskVhdUri01 = "https://contoso.blob.core.windows.net/test/data1.vhd" +PS C:\> $DataDiskVhdUri02 = "https://contoso.blob.core.windows.net/test/data2.vhd" +PS C:\> $DataDiskVhdUri03 = "https://contoso.blob.core.windows.net/test/data3.vhd" +PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $DataDiskVhdUri1 -CreateOption Empty +PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $DataDiskVhdUri2 -CreateOption Empty +PS C:\> $VirtualMachine = Add-AzureRmVMDataDisk -VM $VirtualMachine -Name 'DataDisk3' -Caching 'ReadOnly' -DiskSizeInGB 12 -Lun 2 -VhdUri $DataDiskVhdUri3 -CreateOption Empty +The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The next three commands assign paths of three data disks to the $DataDiskVhdUri01, $DataDiskVhdUri02, and $DataDiskVhdUri03 variables. This approach is only for readability of the following commands. The final three commands each adds a data disk to the virtual machine stored in $VirtualMachine. The command specifies the name and location for the disk, and other properties of the disk. The URI of each disk is stored in $DataDiskVhdUri01, $DataDiskVhdUri02, and $DataDiskVhdUri03.Example 2: Add a data disk to an existing virtual machinePS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Add-AzureRmVMDataDisk -VM $VirtualMachine -Name "disk1" -VhdUri "https://contoso.blob.core.windows.net/vhds/diskstandard03.vhd" -LUN 0 -Caching ReadOnly -DiskSizeinGB 1 -CreateOption Empty +PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine +The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable.The second command adds a data disk to the virtual machine stored in $VirtualMachine. The final command updates the state of the virtual machine stored in $VirtualMachine in ResourceGroup11.Example 3: Add a data disk to a new virtual machine from a generalized user imagePS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" +PS C:\> $DataImageUri = "https://contoso.blob.core.windows.net/system/Microsoft.Compute/Images/captured/dataimage.vhd" +PS C:\> $DataDiskUri = "https://contoso.blob.core.windows.net/test/datadisk.vhd" +PS C:\> $VirtualMachine = Add-AzureVMDataDisk -VM $VirtualMachine -Name "disk1" -SourceImageUri $DataImageUri -VhdUri $DataDiskUri -Lun 0 -CreateOption FromImage +The first command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The next two commands assign paths for the data image and data disks to the $DataImageUri and $DataDiskUri variables respectively. This approach is used to improve the readability of the following commands. The final commands adds a data disk to the virtual machine stored in $VirtualMachine. The command specifies the name and location for the disk and other properties of the disk.Example 4: Add data disks to a new virtual machine from a specialized user imagePS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" +PS C:\> $DataDiskUri = "https://contoso.blob.core.windows.net/test/datadisk.vhd" +PS C:\> $VirtualMachine = Add-AzureVMDataDisk -VM $VirtualMachine -Name "dd1" -VhdUri $DataDiskUri -Lun 0 -CreateOption Attach +The first command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The next commands assigns paths of the data disk to the $DataDiskUri variable. This approach is used to improve the readability of the following commands. The final command add a data disk to the virtual machine stored in $VirtualMachine. The command specifies the name and location for the disk, and other properties of the disk.Remove-AzureRmVMDataDiskGet-AzureRmVMNew-AzureRmVMConfigAdd-AzureRmVMNetworkInterfaceAdds a network interface to a virtual machine.AddAzureRmVMNetworkInterfaceThe Add-AzureRmVMNetworkInterface cmdlet adds a network interface to a virtual machine. You can add an interface when you create a virtual machine or add one to an existing virtual machine.Add-AzureRmVMNetworkInterfaceVMSpecifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet.PSVirtualMachineIdSpecifies the ID of a network interface to add to a virtual machine. You can use the Get-AzureRmNetworkInterface cmdlet to obtain a network interface.StringPrimaryIndicates that this cmdlet adds the network interface as the primary interface. Add-AzureRmVMNetworkInterfaceVMSpecifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet.PSVirtualMachineNetworkInterfaceSpecifies the network interface.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]IdSpecifies the ID of a network interface to add to a virtual machine. You can use the Get-AzureRmNetworkInterface cmdlet to obtain a network interface.StringStringnoneNetworkInterfaceSpecifies the network interface.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]nonePrimaryIndicates that this cmdlet adds the network interface as the primary interface. SwitchParameterSwitchParameternoneVMSpecifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureRmVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureRmVM cmdlet.PSVirtualMachinePSVirtualMachinenoneExample 1: Add a network interface to a new virtual machinePS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" +PS C:\> Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id "/subscriptions/46fc8ea4-2de6-4179-8ab1-365da4121af4/resourceGroups/contoso/providers/Microsoft.Network/networkInterfaces/sshNIC" +The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The second command adds a network interface to the virtual machine stored in $VirtualMachine.Example 2: Add a network interface to an existing virtual machinePS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id "/subscriptions/46fc8ea4-2de6-4179-8ab1-365da4121af4/resourceGroups/contoso/providers/Microsoft.Network/networkInterfaces/sshNIC" +PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine +The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable.The second command adds a network interface to the virtual machine stored in $VirtualMachine. The final command updates the state of the virtual machine stored in $VirtualMachine in ResourceGroup11.New-AzureRmVMConfigGet-AzureRmVMGet-AzureRmAvailabilitySetAdd-AzureRmVMSecretAdds a secret to a virtual machine.AddAzureRmVMSecretThe Add-AzureRmVMSecret cmdlet adds a secret to a virtual machine. This value lets you add a certificate to the virtual machine. The secret must be stored in a Key Vault. For more information about Key Vault, see What is Azure Key Vault? (https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/). For more information about the cmdlets, see Azure Key Vault Cmdlets (https://msdn.microsoft.com/library/azure/dn868052.aspx) in the Microsoft Developer Network library or the Set-AzureKeyVaultSecret cmdlet. Add-AzureRmVMSecretVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. PSVirtualMachineSourceVaultIdSpecifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for SourceVaultId when you add multiple certificates from the same Key Vault.StringCertificateStoreSpecifies the name of a certificate store on the virtual machine that runs the Windows operating system. This cmdlet adds the certificate to the store that this parameter specifies. You can only specify this parameter for virtual machines that run the Windows operating system.StringCertificateUrlSpecifies the URL that points to a Key Vault secret which contains a certificate.The certificate is the Base64 encoding of the following JavaScript Object Notation (JSON) object, which is encoded in UTF-8:{ +"data": "<Base64-encoded-file>", +"dataType": "<file-format>", +"password": "<pfx-file-password>" +}Currently, dataType accepts only .pfx files. StringCertificateStoreSpecifies the name of a certificate store on the virtual machine that runs the Windows operating system. This cmdlet adds the certificate to the store that this parameter specifies. You can only specify this parameter for virtual machines that run the Windows operating system.StringStringnoneCertificateUrlSpecifies the URL that points to a Key Vault secret which contains a certificate.The certificate is the Base64 encoding of the following JavaScript Object Notation (JSON) object, which is encoded in UTF-8:{ +"data": "<Base64-encoded-file>", +"dataType": "<file-format>", +"password": "<pfx-file-password>" +}Currently, dataType accepts only .pfx files. StringStringnoneSourceVaultIdSpecifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for SourceVaultId when you add multiple certificates from the same Key Vault.StringStringnoneVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. PSVirtualMachinePSVirtualMachinenoneExample 1: Add a secret to a virtual machinePS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id PS C:\> $Credential = Get-Credential -PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName "Contoso26" -Credential $Credential -PS C:\> $SourceVaultId = "/subscriptions/46f8cea4-2de6-4179-8ab1-365da4211af4/resourceGroups/vault/providers/Microsoft.KeyVault/vaults/keyvault" -PS C:\> $CertificateStore01 = "My" -PS C:\> $CertificateUrl01 = "https://contosovault.vault.azure.net/secrets/514ceb769c984379a7e0230bdd703272" -PS C:\> $VirtualMachine = Add-AzureRmVMSecret -VM $VirtualMachine -SourceVaultId $SourceVaultId -CertificateStore $CertificateStore01 -CertificateUrl $CertificateUrl01 - - The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. - - - The fourth command assigns a source vault ID to the $SourceVaultId variable for later use. The command assumes that the $SubscriptionId variable has an appropriate value. - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVMConfig - - - - Set-AzureRmVMOperatingSystem - - - - - - - - Add-AzureRmVmssAdditionalUnattendContent - - Adds information to the unattended Windows Setup answer file. - - - - - Add - AzureRmVmssAdditionalUnattendContent - - - - The Add-AzureRmVMAdditionalUnattendContent cmdlet adds information to the unattended Windows Setup answer file. - - - - Add-AzureRmVmssAdditionalUnattendContent - - VirtualMachineScaleSet - - Specify the virtual machine Scale Set object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - - PassName - - Specifies the name of the pass that the content applies to. The only allowable value is oobeSystem. - - Nullable`1[PassNames] - - - ComponentName - - Specifies the name of the component to configure with the added content. The only allowable value is Microsoft-Windows-Shell-Setup. - - Nullable`1[ComponentNames] - - - SettingName - - Specifies the name of the setting to which the content applies. The acceptable values for this parameter are:: - -- FirstLogonCommands --- AutoLogon - - Nullable`1[SettingNames] - - - Content - - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specify the virtual machine Scale Set object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - PassName - - Specifies the name of the pass that the content applies to. The only allowable value is oobeSystem. - - Nullable`1[PassNames] - - Nullable`1[PassNames] - - - none - - - ComponentName - - Specifies the name of the component to configure with the added content. The only allowable value is Microsoft-Windows-Shell-Setup. - - Nullable`1[ComponentNames] - - Nullable`1[ComponentNames] - - - none - - - SettingName - - Specifies the name of the setting to which the content applies. The acceptable values for this parameter are:: - -- FirstLogonCommands --- AutoLogon - - Nullable`1[SettingNames] - - Nullable`1[SettingNames] - - - none - - - Content - - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add information to the unattended Windows Setup answer file -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVmssAdditionalUnattendContent -VirtualMachineScaleSet $VMSS -ComponentName $AUCComponentName -Content $AUCContent -PassName $AUCPassName -SettingName $AUCSetting - - This command adds information to the unattended Windows Setup answer file. - - - - - - - - - - - - - - - - New-AzureRmVmssConfig - - - - - - - - Add-AzureRmVmssExtension - - Adds an extension to the VMSS. - - - - - Add - AzureRmVmssExtension - - - - The Add-AzureRmVmssExtension cmdlet adds an extension to the Virtual Machine Scale Set (VMSS). - - - - Add-AzureRmVmssExtension - - VirtualMachineScaleSet - - Specify the VMSS object. You can use the New-AzureRmVmssConfig to create the object. - - VirtualMachineScaleSet - - - Name - - Specifies the name of the extension that this cmdlet adds. - - String - - - Publisher - - Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. This can use the Get-AzureRmVMImagePublisher cmdlet to get the publisher. - - String - - - Type - - Specifies the extension type. You can use the Get-AzureRmVMExtensionImageType cmdlet to get the extension type. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. You can use the Get-AzureRmVMExtensionImage cmdlet to get the version of the extension. - - String - - - AutoUpgradeMinorVersion - - Indicates whether the extension version should be automatically updated to a newer minor version. - - Nullable`1[Boolean] - - - Setting - - Specifies the public configuration, as a string, for the extension. This cmdlet does not encrypt public configuration. - - Object - - - ProtectedSetting - - Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration. - - Object - - - Id - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specify the VMSS object. You can use the New-AzureRmVmssConfig to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Name - - Specifies the name of the extension that this cmdlet adds. - - String - - String - - - none - - - Publisher - - Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. This can use the Get-AzureRmVMImagePublisher cmdlet to get the publisher. - - String - - String - - - none - - - Type - - Specifies the extension type. You can use the Get-AzureRmVMExtensionImageType cmdlet to get the extension type. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. You can use the Get-AzureRmVMExtensionImage cmdlet to get the version of the extension. - - String - - String - - - none - - - AutoUpgradeMinorVersion - - Indicates whether the extension version should be automatically updated to a newer minor version. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - Setting - - Specifies the public configuration, as a string, for the extension. This cmdlet does not encrypt public configuration. - - Object - - Object - - - none - - - ProtectedSetting - - Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration. - - Object - - Object - - - none - - - Id - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Add an extension to the VMSS -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVmssExtension -VirtualMachineScaleSet $VMSS -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $True - - This command adds an extension to the VMMS. - - - - - - - - - - - - - - - - Remove-AzureRmVmssExtension - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMExtensionImageType - - - - Get-AzureRmVMExtensionImage - - - - New-AzureRmVmssConfig - - - - - - - - Add-AzureRmVMSshPublicKey - - Adds the public keys for SSH for a virtual machine. - - - - - Add - AzureRmVMSshPublicKey - - - - The Add-AzureRmVMSshPublicKey cmdlet adds the public keys that you can use to connect to a virtual machine over Secure Shell (SSH). - - - - Add-AzureRmVMSshPublicKey - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - - KeyData - - Specifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH or by using the key that this parameter specifies. - - String - - - Path - - Specifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - KeyData - - Specifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH or by using the key that this parameter specifies. - - String - - String - - - none - - - Path - - Specifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a public key to a virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -PS C:\> $VirtualMachine = Add-AzureRmVMSshPublicKey -VM $VirtualMachine -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys" - - The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVMConfig - - - - - - - - Add-AzureRmVmssNetworkInterfaceConfiguration - - Adds a network interface configuration to the VMSS. - - - - - Add - AzureRmVmssNetworkInterfaceConfiguration - - - - The Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet adds a network interface configuration to the Virtual Machine Scale Set (VMSS). - - - - Add-AzureRmVmssNetworkInterfaceConfiguration - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - - Name - - Specifies the name of the network interface configuration. - - String - - - Primary - - Indicates whether network interfaces created from the network interface configuration will be the primary network information center (NIC) of the virtual machine. - - Nullable`1[Boolean] - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - IpConfiguration - - Specifies the IP configurations of the network interface. - - VirtualMachineScaleSetIPConfiguration[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Name - - Specifies the name of the network interface configuration. - - String - - String - - - none - - - Primary - - Indicates whether network interfaces created from the network interface configuration will be the primary network information center (NIC) of the virtual machine. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - IpConfiguration - - Specifies the IP configurations of the network interface. - - VirtualMachineScaleSetIPConfiguration[] - - VirtualMachineScaleSetIPConfiguration[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Add a network interface configuration to the VMSS -------------------------- - - PS C:\> - - PS C:\>Add-AzureRmVmssNetworkInterfaceConfiguration -VirtualMachineScaleSet $VMSS -Name "Test" -Primary $True -IPConfiguration $IPCfg - - This command adds a network interface configuration to the VMSS. - - - - - - - - - - - - - - - - New-AzureRmVmssConfig - - - - - - - - Add-AzureRmVmssSecret - - Adds a secret to a VMSS. - - - - - Add - AzureRmVmssSecret - - - - The Add-AzureRmVmssSecret cmdlet adds a secret to the Virtual Machine Scale Set (VMSS). The secret must be stored in an Azure Key Vault. For more information relating to Key Vault, see What is Azure Key Vault? (https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/). For more information about the cmdlets, see Azure Key Vault Cmdlets(https://msdn.microsoft.com/library/azure/dn868052.aspx) in the Microsoft Developer Network library or the Set-AzureKeyVaultSecret cmdlet. - - - - Add-AzureRmVmssSecret - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create this object. - - VirtualMachineScaleSet - - - SourceVaultId - - Specifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for the SourceVaultId parameter when you add multiple certificates from the same Key Vault. - - String - - - VaultCertificate - - Specifies the Vault Certificate object that contains the certificate URL and certificate name. You can use the New-AzureRmVmssVaultCertificateConfig cmdlet to create this object. - - VaultCertificate[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create this object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - SourceVaultId - - Specifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for the SourceVaultId parameter when you add multiple certificates from the same Key Vault. - - String - - String - - - none - - - VaultCertificate - - Specifies the Vault Certificate object that contains the certificate URL and certificate name. You can use the New-AzureRmVmssVaultCertificateConfig cmdlet to create this object. - - VaultCertificate[] - - VaultCertificate[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Add a secret to the VMSS -------------------------- - - PS C:\> - - PS C:\>$Vault = Get-AzureRmKeyVault -VaultName "ContosoVault" -PS C:\> $CertConfig = New-AzureRmVmssVaultCertificateConfig -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" -CertificateStore "Certificates" +PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName "Contoso26" -Credential $Credential +PS C:\> $SourceVaultId = "/subscriptions/46f8cea4-2de6-4179-8ab1-365da4211af4/resourceGroups/vault/providers/Microsoft.KeyVault/vaults/keyvault" +PS C:\> $CertificateStore01 = "My" +PS C:\> $CertificateUrl01 = "https://contosovault.vault.azure.net/secrets/514ceb769c984379a7e0230bdd703272" +PS C:\> $VirtualMachine = Add-AzureRmVMSecret -VM $VirtualMachine -SourceVaultId $SourceVaultId -CertificateStore $CertificateStore01 -CertificateUrl $CertificateUrl01 +The first command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The second command creates a credential object by using the Get-Credential cmdlet, and then stores the result in the $Credential variable. The command prompts you for a user name and password. For more information, type Get-Help Get-Credential. The third command uses the Set-AzureRmVMOperatingSystem cmdlet to configure the virtual machine stored in $VirtualMachine. The fourth command assigns a source vault ID to the $SourceVaultId variable for later use. The command assumes that the $SubscriptionId variable has an appropriate value. The fifth command assigns a value to the $CertificateStore01 variable for later use. The sixth command assigns a URL for a certificate store. The seventh command adds a secret to the virtual machine stored in $VirtualMachine. The SourceVaultId parameter specifies the Key Vault. The command specifies the name of the certificate store and the URL of the certificate. You can run the Add-AzureRmVMSecret repeatedly to add secrets for other certificates.Get-AzureRmVMNew-AzureRmVMConfigSet-AzureRmVMOperatingSystemAdd-AzureRmVmssAdditionalUnattendContentAdds information to the unattended Windows Setup answer file.AddAzureRmVmssAdditionalUnattendContentThe Add-AzureRmVmssAdditionalUnattendContent cmdlet adds information to the unattended Windows Setup answer file.Add-AzureRmVmssAdditionalUnattendContentVirtualMachineScaleSetSpecify the virtual machine Scale Set object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetPassNameSpecifies the name of the pass that the content applies to. The only allowable value is oobeSystem.PassNames]ComponentNameSpecifies the name of the component to configure with the added content. The only allowable value is Microsoft-Windows-Shell-Setup.ComponentNames]SettingNameSpecifies the name of the setting to which the content applies. The acceptable values for this parameter are:: + +-- FirstLogonCommands +-- AutoLogonSettingNames]ContentSpecifies the XML formatted content that is added to the unattend.xml file for the specified path and component.StringComponentNameSpecifies the name of the component to configure with the added content. The only allowable value is Microsoft-Windows-Shell-Setup.ComponentNames]ComponentNames]noneContentSpecifies the XML formatted content that is added to the unattend.xml file for the specified path and component.StringStringnonePassNameSpecifies the name of the pass that the content applies to. The only allowable value is oobeSystem.PassNames]PassNames]noneSettingNameSpecifies the name of the setting to which the content applies. The acceptable values for this parameter are:: + +-- FirstLogonCommands +-- AutoLogonSettingNames]SettingNames]noneVirtualMachineScaleSetSpecify the virtual machine Scale Set object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetVirtualMachineScaleSetnoneExample 1: Add information to the unattended Windows Setup answer filePS C:\>Add-AzureRmVmssAdditionalUnattendContent -VirtualMachineScaleSet $VMSS -ComponentName $AUCComponentName -Content $AUCContent -PassName $AUCPassName -SettingName $AUCSetting +This command adds information to the unattended Windows Setup answer file.New-AzureRmVmssConfigAdd-AzureRmVmssExtensionAdds an extension to the VMSS.AddAzureRmVmssExtensionThe Add-AzureRmVmssExtension cmdlet adds an extension to the Virtual Machine Scale Set (VMSS).Add-AzureRmVmssExtensionVirtualMachineScaleSetSpecify the VMSS object. You can use the New-AzureRmVmssConfig to create the object.VirtualMachineScaleSetNameSpecifies the name of the extension that this cmdlet adds.StringPublisherSpecifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. This can use the Get-AzureRmVMImagePublisher cmdlet to get the publisher.StringTypeSpecifies the extension type. You can use the Get-AzureRmVMExtensionImageType cmdlet to get the extension type.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. You can use the Get-AzureRmVMExtensionImage cmdlet to get the version of the extension. StringAutoUpgradeMinorVersionIndicates whether the extension version should be automatically updated to a newer minor version.Boolean]SettingSpecifies the public configuration, as a string, for the extension. This cmdlet does not encrypt public configuration.ObjectProtectedSettingSpecifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.ObjectIdSpecifies an ID.StringAutoUpgradeMinorVersionIndicates whether the extension version should be automatically updated to a newer minor version.Boolean]Boolean]noneIdSpecifies an ID.StringStringnoneNameSpecifies the name of the extension that this cmdlet adds.StringStringnoneProtectedSettingSpecifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.ObjectObjectnonePublisherSpecifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. This can use the Get-AzureRmVMImagePublisher cmdlet to get the publisher.StringStringnoneSettingSpecifies the public configuration, as a string, for the extension. This cmdlet does not encrypt public configuration.ObjectObjectnoneTypeSpecifies the extension type. You can use the Get-AzureRmVMExtensionImageType cmdlet to get the extension type.StringStringnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. You can use the Get-AzureRmVMExtensionImage cmdlet to get the version of the extension. StringStringnoneVirtualMachineScaleSetSpecify the VMSS object. You can use the New-AzureRmVmssConfig to create the object.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output.Example 1: Add an extension to the VMSSPS C:\>Add-AzureRmVmssExtension -VirtualMachineScaleSet $VMSS -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $True +This command adds an extension to the VMMS.Remove-AzureRmVmssExtensionGet-AzureRmVMImagePublisherGet-AzureRmVMExtensionImageTypeGet-AzureRmVMExtensionImageNew-AzureRmVmssConfigAdd-AzureRmVMSshPublicKeyAdds the public keys for SSH for a virtual machine.AddAzureRmVMSshPublicKeyThe Add-AzureRmVMSshPublicKey cmdlet adds the public keys that you can use to connect to a virtual machine over Secure Shell (SSH). Add-AzureRmVMSshPublicKeyVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. PSVirtualMachineKeyDataSpecifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH or by using the key that this parameter specifies. StringPathSpecifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. StringKeyDataSpecifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH or by using the key that this parameter specifies. StringStringnonePathSpecifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. StringStringnoneVMSpecifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. PSVirtualMachinePSVirtualMachinenoneExample 1: Add a public key to a virtual machinePS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> $VirtualMachine = Add-AzureRmVMSshPublicKey -VM $VirtualMachine -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys" +The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. The second command adds the public key to the location on VirtualMachine07 that the Path parameter specifies.Get-AzureRmVMNew-AzureRmVMConfigAdd-AzureRmVmssNetworkInterfaceConfigurationAdds a network interface configuration to the VMSS.AddAzureRmVmssNetworkInterfaceConfigurationThe Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet adds a network interface configuration to the Virtual Machine Scale Set (VMSS).Add-AzureRmVmssNetworkInterfaceConfigurationVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetNameSpecifies the name of the network interface configuration.StringPrimaryIndicates whether network interfaces created from the network interface configuration will be the primary network information center (NIC) of the virtual machine.Boolean]IdSpecifies the Resource ID of the virtual machine. StringIpConfigurationSpecifies the IP configurations of the network interface.VirtualMachineScaleSetIPConfiguration[]IdSpecifies the Resource ID of the virtual machine. StringStringnoneIpConfigurationSpecifies the IP configurations of the network interface.VirtualMachineScaleSetIPConfiguration[]VirtualMachineScaleSetIPConfiguration[]noneNameSpecifies the name of the network interface configuration.StringStringnonePrimaryIndicates whether network interfaces created from the network interface configuration will be the primary network information center (NIC) of the virtual machine.Boolean]Boolean]noneVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output. Example 1: Add a network interface configuration to the VMSSPS C:\>Add-AzureRmVmssNetworkInterfaceConfiguration -VirtualMachineScaleSet $VMSS -Name "Test" -Primary $True -IPConfiguration $IPCfg + +This command adds a network interface configuration to the VMSS.New-AzureRmVmssConfigAdd-AzureRmVmssSecretAdds a secret to a VMSS.AddAzureRmVmssSecretThe Add-AzureRmVmssSecret cmdlet adds a secret to the Virtual Machine Scale Set (VMSS). The secret must be stored in an Azure Key Vault. For more information relating to Key Vault, see What is Azure Key Vault? (https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/). For more information about the cmdlets, see Azure Key Vault Cmdlets(https://msdn.microsoft.com/library/azure/dn868052.aspx) in the Microsoft Developer Network library or the Set-AzureKeyVaultSecret cmdlet.Add-AzureRmVmssSecretVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create this object.VirtualMachineScaleSetSourceVaultIdSpecifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for the SourceVaultId parameter when you add multiple certificates from the same Key Vault.StringVaultCertificateSpecifies the Vault Certificate object that contains the certificate URL and certificate name. You can use the New-AzureRmVmssVaultCertificateConfig cmdlet to create this object.VaultCertificate[]SourceVaultIdSpecifies the resource ID of the Key Vault that contains the certificates that you can add to the virtual machine. This value also acts as the key for adding multiple certificates. This means that you can use the same value for the SourceVaultId parameter when you add multiple certificates from the same Key Vault.StringStringnoneVaultCertificateSpecifies the Vault Certificate object that contains the certificate URL and certificate name. You can use the New-AzureRmVmssVaultCertificateConfig cmdlet to create this object.VaultCertificate[]VaultCertificate[]noneVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create this object.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output.Example 1: Add a secret to the VMSSPS C:\>$Vault = Get-AzureRmKeyVault -VaultName "ContosoVault" +PS C:\> $CertConfig = New-AzureRmVmssVaultCertificateConfig -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" -CertificateStore "Certificates" PS C:\> $VMSS = New-AzureRmVmssConfig -PS C:\> Add-AzureRmVmssSecret -VirtualMachineScaleSet $VMSS -SourceVaultId $Vault.ResourceId -VaultCertificate $CertConfig - - This example adds a secret to the VMSS. The first command uses the Get-AzureRmKeyVault cmdlet to get a vault secret from the vault named ContosoVault and stores the result in the variable named $Vault. The second command uses the New-AzureRmVmssVaultCertificateConfig cmdlet to create a Key Vault certificate configuration using the specified certificate URL from the certificate store named Certificates and stores the results in the variable named $CertConfig. The third command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The fourth command adds a secret to the VMSS using the vault secret using the key resource ID and the vault certificate stored in the $Vault and $CertConfig variables. - - - - - - - - - - - - - - - - New-AzureRmVmssVaultCertificateConfig - - - - New-AzureRmVmssConfig - - - - - - - - Add-AzureRmVmssSshPublicKey - - Adds SSH public keys to the VMSS. - - - - - Add - AzureRmVmssSshPublicKey - - - - The Add-AzureRmVMSshPublicKey cmdlet adds the public keys that you can use to connect to the Virtual Machine Scale Set (VMSS) virtual machines over Secure Shell (SSH). - - - - Add-AzureRmVmssSshPublicKey - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - - Path - - Specifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. - - String - - - KeyData - - Specifies a SSH RSA public key data. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Path - - Specifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file. - - String - - String - - - none - - - KeyData - - Specifies a SSH RSA public key data. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Add an SSH public key to the VMSS -------------------------- - - PS C:\> - - PS C:\>$VMSS = New-AzureRmVmssConfig -PS C:\> Add-AzureRmVmssSshPublicKey -VirtualMachineScaleSet $VMSS -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys" - - This example adds an SSH public key to the VMSS. - - - - - - - - - - - - - - - - New-AzureRmVmssConfig - - - - - - - - Add-AzureRmVmssWinRMListener - - Adds a WinRM listener to the VMSS. - - - - - Add - AzureRmVmssWinRMListener - - - - This cmdlet adds a Windows Remote Management (WinRM) listener on the Virtual Machine Scale Set (VMSS). - - - - Add-AzureRmVmssWinRMListener - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - - Protocol - - Specifies the protocol of the WinRM listener. The acceptable values for this parameter are: - -- Http --- Https - - Nullable`1[ProtocolTypes] - - - CertificateUrl - - Specifies a link, as a URL, of the certificate with which new virtual machines are provisioned. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Protocol - - Specifies the protocol of the WinRM listener. The acceptable values for this parameter are: - -- Http --- Https - - Nullable`1[ProtocolTypes] - - Nullable`1[ProtocolTypes] - - - none - - - CertificateUrl - - Specifies a link, as a URL, of the certificate with which new virtual machines are provisioned. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a WinRM listener to the VMSS -------------------------- - - PS C:\> - - PS C:\>$VMSS = New-AzureRmVmssConfig -PS C:\> Add-AzureRmVmssWinRMListener -VirtualMachineScaleSet $VMSS -Protocol Https -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" - - This example adds a WinRM listener to the VMSS. - - - - - - - - - - - - - - - - New-AzureRmVmssConfig - - - - - - - - Disable-AzureRmVMDiskEncryption - - Disables encryption on an IaaS virtual machine. - - - - - Disable - AzureRmVMDiskEncryption - - - - The Disable-AzureRmVMDiskEncryption cmdlet disables encryption on an infrastructure as a service (IaaS) virtual machine. This cmdlet installs an extension on the virtual machine to disable encryption. If the Name parameter is not specified, extension with the name "AzureDiskEncryption/AzureDiskEncryptionForLinux" (depending on the OS) is used. Caution: This cmdlet reboots the virtual machine. - On Linux IaaS VMs, Disable-AzureRMVMDiskEncryption is not supported for VolumeType "OS". - - - - Disable-AzureRmVMDiskEncryption - - ResourceGroupName - - Specifies the resource group name of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine that this cmdlet disables encryption on. - - String - - - VolumeType - - Specifes the type of virtual machine volumes to perform the encryption operation. For Windows virtual machines, valid values are: - -- "All" --- "OS" --- "Data". If you do not specify a value for this parameter, the default value is All. Disable encryption is not currently supported for Linux. - - String - - - Name - - Specifes the name of the Azure Resource Manager (ARM) resource that represents the extension. If this parameter is not specified, this cmdlet defaults to "AzureDiskEncryption for Windows VMs". - - String - - - TypeHandlerVersion - - Specifies the version of the encryption extension. If you do not specify a value for this parameter, the latest version of the extension is used. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet disables auto-upgrade of the minor version of the extension. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the resource group name of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine that this cmdlet disables encryption on. - - String - - String - - - none - - - VolumeType - - Specifes the type of virtual machine volumes to perform the encryption operation. For Windows virtual machines, valid values are: - -- "All" --- "OS" --- "Data". If you do not specify a value for this parameter, the default value is All. Disable encryption is not currently supported for Linux. - - String - - String - - - none - - - Name - - Specifes the name of the Azure Resource Manager (ARM) resource that represents the extension. If this parameter is not specified, this cmdlet defaults to "AzureDiskEncryption for Windows VMs". - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the encryption extension. If you do not specify a value for this parameter, the latest version of the extension is used. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet disables auto-upgrade of the minor version of the extension. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Disable encryption for all volumes on a Windows virtual machine -------------------------- - - PS C:\> - - PS C:\>Disable-AzureRMVMDiskEncryption -ResourceGroupName "Group001" -VMName "VM002" - - This command disables encryption for volumes of type all for the virtual machine named VM002 that belongs to the resource group named Group001. Since the VolumeType parameter is not specified, the cmdlet sets the value to All. - - - - - - - - - - - - - - -------------------------- Example 2: Disable encryption for data volumes on a Windows virtual machine -------------------------- - - PS C:\> - - PS C:\>$ResourceGroup = "Group002"; -PS C:\> $VMName = "VM004"; -PS C:\> Disable-AzureRMVMDiskEncryption -ResourceGroupName "Group002" -VMName "VM004" -VolumeType "Data" - - This command disables encryption for volumes of type data for the virtual machine named VM004 that belongs to the resource group named Group002. - - - - - - - - - - - - - - - - Get-AzureRmVMDiskEncryptionStatus - - - - Remove-AzureRmVMDiskEncryptionExtension - - - - Set-AzureRmVMDiskEncryptionExtension - - - - - - - - Get-AzureRmAvailabilitySet - - Gets Azure availability sets in a resource group. - - - - - Get - AzureRmAvailabilitySet - - - - The Get-AzureRmAvailabilitySet cmdlet gets Azure availability sets in a resource group. You can specify the name of a specific availability set to get. - - - - Get-AzureRmAvailabilitySet - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies the name of an availability set that this cmdlet gets. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Name - - Specifies the name of an availability set that this cmdlet gets. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get a specific availability set -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" - - This command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11. - - - - - - - - - - - - - - -------------------------- Example 2: Get all availability sets -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" - - This command gets all the availability sets in the resource group named ResourceGroup11. - - - - - - - - - - - - - - - - New-AzureRmAvailabilitySet - - - - Remove-AzureRmAvailabilitySet - - - - - - - - Get-AzureRmContainerService - - Get the container service information - - - - - Get - AzureRmContainerService - - - - This cmdlet returns the properties for the specified container service including state, number of master and agents, FQDN of master, agent. - - - - Get-AzureRmContainerService - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Resource Group of the container service - - String - - - Name - - Name of the container service - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group of the container service - - String - - String - - - - - - Name - - Name of the container service - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureRmContainerService -ResourceGroupName $rgname -Name $csName; - - - - - - - - - - - - - - - - - - - - - - Get-AzureRmRemoteDesktopFile - - Gets an .rdp file. - - - - - Get - AzureRmRemoteDesktopFile - - - - The Get-AzureRmRemoteDesktopFile cmdlet gets a Remote Desktop Protocol (.rdp) file. - - - - Get-AzureRmRemoteDesktopFile - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies the name of the availability set that this cmdlet gets. - - String - - - LocalPath - - Specifies the local full path where this cmdlet stores the .rdp file. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmRemoteDesktopFile - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies the name of the availability set that this cmdlet gets. - - String - - - LocalPath - - Specifies the local full path where this cmdlet stores the .rdp file. - - String - - - Launch - - Indicates that this cmdlet launches Remote Desktop after it gets the .rdp file. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Name - - Specifies the name of the availability set that this cmdlet gets. - - String - - String - - - none - - - LocalPath - - Specifies the local full path where this cmdlet stores the .rdp file. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Launch - - Indicates that this cmdlet launches Remote Desktop after it gets the .rdp file. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get a Remote Desktop file -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmRemoteDesktopFile -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -LocalPath "D:\RemoteDesktopFile07.rdp" - - This command gets the Remote Desktop file for the virtual machine named VirtualMachine07. The command stores the result in the file named D:\RemoteDesktopFile07.rdp. - - - - - - - - - - - - - - - - - - - - Get-AzureRmVM - - Gets the properties of a virtual machine. - - - - - Get - AzureRmVM - - - - The Get-AzureRmVM cmdlet gets the model view and instance view of an Azure virtual machine. The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine. - - - - Get-AzureRmVM - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVM - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVM - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies the name of the virtual machine to get. - - String - - - Status - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVM - - NextLink - - Specifies the next link. - - Uri - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Name - - Specifies the name of the virtual machine to get. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - NextLink - - Specifies the next link. - - Uri - - Uri - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get model and instance view properties -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" - - This command gets the model view and instance view properties of the virtual machine named VirtualMachine07. - - - - - - - - - - - - - - -------------------------- Example 2: Get instance view properties -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Status - - This command gets properties of the virtual machine named VirtualMachine07. This command specifies the Status parameter. Therefore, the command gets only the instance view properties. - - - - - - - - - - - - - - -------------------------- Example 3: Get properties for all virtual machines in a resource group -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" - - This command gets properties for all the virtual machines in the resource group named ResourceGroup11. - - - - - - - - - - - - - - -------------------------- Example 4: Get all virtual machines in your subscription -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVM - - This command gets all the virtual machines in your subscription. - - - - - - - - - - - - - - - - New-AzureRmVM - - - - Remove-AzureRmVM - - - - Restart-AzureRmVM - - - - Start-AzureRmVM - - - - Stop-AzureRmVM - - - - Update-AzureRmVM - - - - - - - - Get-AzureRmVMAccessExtension - - Gets information about the VMAccess extension. - - - - - Get - AzureRmVMAccessExtension - - - - The Get-AzureRmVMAccessExtension cmdlet gets information about the Virtual Machine Access (VMAccess) Virtual Machine Extension. - - - - Get-AzureRmVMAccessExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets information about VMAccess for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the extension that this cmdlet gets. - - String - - - Status - - Indicates that this cmdlet gets only the instance view of the extension. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets information about VMAccess for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the extension that this cmdlet gets. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets only the instance view of the extension. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the VMAccess extension -------------------------- - - PS C:\> - - PS C:\>$VMAccessExtension = Get-AzureRmVMAccessExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoTest" - - This command gets the VMAccess extension named ContosoTest for the virtual machine named VirtualMachine07. - - - - - - - - - - - - - - -------------------------- Example 2: Get the instance view of the VMAccess extension -------------------------- - - PS C:\> - - PS C:\>$VMAccessExtension = Get-AzureRmVMAccessExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoTest" -Status - - This command gets the instance view of the VMAccess extension named ContosoTest for the virtual machine named VirtualMachine07. - - - - - - - - - - - - - - - - Remove-AzureRmVMAccessExtension - - - - Set-AzureRmVMAccessExtension - - - - Get-AzureRmVMExtension - - - - - - - - Get-AzureRmVMADDomainExtension - - Gets information about a AD domain extension. - - - - - Get - AzureRmVMADDomainExtension - - - - The Get-AzureRmVMADDomainExtension cmdlet gets information about the Azure AD Domain extension. - - - - Get-AzureRmVMADDomainExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - Status - - - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - - - - VMName - - - - String - - String - - - - - - Name - - - - String - - String - - - - - - Status - - - - SwitchParameter - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get-AzureRmVMAEMExtension - - Gets information about the AEM extension. - - - - - Get - AzureRmVMAEMExtension - - - - The Get-AzureRmVMAEMExtension cmdlet gets information about the Azure Enhanced Monitoring (AEM) extension. - - - - Get-AzureRmVMAEMExtension - - ResourceGroupName - - Specifies the name of the resource group of a virtual machine. This cmdlet gets information for the AEM extension on that virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets information about AEM extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of a virtual machine. This cmdlet gets information for the AEM extension on the virtual machine that this cmdlet specifies. - - String - - - Status - - Indicates that this cmdlet gets only the instance view of the AEM extension. - - SwitchParameter - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of a virtual machine. This cmdlet gets information for the AEM extension on that virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets information about AEM extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of a virtual machine. This cmdlet gets information for the AEM extension on the virtual machine that this cmdlet specifies. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets only the instance view of the AEM extension. - - SwitchParameter - - SwitchParameter - - - none - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the AEM extension -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" - - This command gets information for the AEM extension for the virtual machine named contoso-server. - - - - - - - - - - - - - - - - Remove-AzureRmVMAEMExtension - - - - Set-AzureRmVMAEMExtension - - - - Test-AzureRmVMAEMExtension - - - - - - - - Get-AzureRmVMBootDiagnosticsData - - Get the boot diagnostics data for the Virtual Machine - - - - - Get - AzureRmVMBootDiagnosticsData - - - - This cmdlet allows you to get the Boot Diagnostics data for the Virtual Machine - - - - Get-AzureRmVMBootDiagnosticsData - - ResourceGroupName - - Resource Group of the Virtual Machine - - String - - - Name - - Name of the Virtual Machine - - String - - - Windows - - Specifies if this is a Windows Virtual Machine - - SwitchParameter - - - LocalPath - - Local path on your disk where to save the data - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVMBootDiagnosticsData - - ResourceGroupName - - Resource Group of the Virtual Machine - - String - - - Name - - Name of the Virtual Machine - - String - - - Linux - - Specifies if it's a Linux Virtual Machine - - SwitchParameter - - - LocalPath - - Local path on your disk where to save the data - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the Virtual Machine - - String - - String - - - none - - - Name - - Name of the Virtual Machine - - String - - String - - - none - - - Windows - - Specifies if this is a Windows Virtual Machine - - SwitchParameter - - SwitchParameter - - - none - - - LocalPath - - Local path on your disk where to save the data - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Linux - - Specifies if it's a Linux Virtual Machine - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Get-AzureRmVMCustomScriptExtension - - Gets information about a custom script extension. - - - - - Get - AzureRmVMCustomScriptExtension - - - - The Get-AzureRmVMCustomScriptExtension cmdlet gets information about a custom script Virtual Machine Extension on a virtual machine. - - - - Get-AzureRmVMCustomScriptExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the custom script extension. - - String - - - Name - - Specifies the name of the custom script extension about which this cmdlet gets information. - - String - - - Status - - Indicates that this cmdlet gets the instance view of the custom script extension. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the custom script extension. - - String - - String - - - none - - - Name - - Specifies the name of the custom script extension about which this cmdlet gets information. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets the instance view of the custom script extension. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get a custom script extension -------------------------- - - PS C:\> - - PS C:\>$VMCustomScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoCustomScript" - - This command gets the custom script extension named ContosoCustomScript for the virtual machine named VirtualMachine07. - - - - - - - - - - - - - - -------------------------- Example 2: Get the instance view of a custom script extension -------------------------- - - PS C:\> - - PS C:\>$VMCustomScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoCustomScript" -Status - - This command gets the instance view of the custom script extension named ContosoCustomScript for the virtual machine named VirtualMachine07. - - - - - - - - - - - - - - - - Get-AzureRmVMExtension - - - - Get-AzureRmVMExtensionImage - - - - Get-AzureRmVMAccessExtension - - - - - - - - Get-AzureRmVMDiagnosticsExtension - - - - - - - Get - AzureRmVMDiagnosticsExtension - - - - - - - - Get-AzureRmVMDiagnosticsExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - Status - - - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - Status - - - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Get-AzureRmVMDiskEncryptionStatus - - Gets the encryption status of the virtual machine. - - - - - Get - AzureRmVMDiskEncryptionStatus - - - - The Get-AzureRmVMDiskEncryptionStatus cmdlet gets the encryption status of the virtual machine. It displays the encryption status of the operating system and data volumes. In addition to encryption status, it also displays the encryption secret URL, key encryption key URL, resource IDs of the KeyVaults where the encryption key and key encryption key for operating system volume are present. - For more details on the encryption status, refer to https://gallery.technet.microsoft.com/Azure-Disk-Encryption-for-a0018eb0 - - - - Get-AzureRmVMDiskEncryptionStatus - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - On some versions of Linux, the encryption status is reported as "Unknown". This is caused by an issue in Linux Agent. The correct status shall be shown once the Linux distribution consumes the updated Linux Agent. Refer to https://github.com/Azure/WALinuxAgent/issues/388 for technical details. - - - - - -------------------------- Example 1: Get the encryption status of a virtual machine -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName "MyResourceGroup001" -VMName "VM001" - - This command gets the encryption status of the virtual machine named VM001. - - - - - - - - - - - - - - - - Remove-AzureRmVMDiskEncryptionExtension - - - - Set-AzureRmVMDiskEncryptionExtension - - - - - - - - Get-AzureRmVMDscExtension - - Gets the settings of the DSC extension on a particular virtual machine. - - - - - Get - AzureRmVMDscExtension - - - - The Get-AzureRmVMDscExtension cmdlet gets the settings of the Desired State Configuration (DSC) extension on a particular virtual machine. - - - - Get-AzureRmVMDscExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the DSC extension. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed the default name in the Set-AzureRmVMDscExtension cmdlet or used a different resource name in a Resource Manager template. - - String - - - Status - - Indicates that this cmdlet gets the instance view of the DSC extension. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the DSC extension. - - String - - String - - - none - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed the default name in the Set-AzureRmVMDscExtension cmdlet or used a different resource name in a Resource Manager template. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets the instance view of the DSC extension. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - Microsoft.Azure.Commands.Compute.Extension.DSC.VirtualMachineDscExtensionContext - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the settings of a DSC extension -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup002" -VMName "VM07" -Name "DSC" - - This command gets the settings of extension named DSC on the virtual machine named VM07. - - - - - - - - - - - - - - - - Remove-AzureRmVMDscExtension - - - - Set-AzureRmVMDscExtension - - - - - - - - Get-AzureRmVMDscExtensionStatus - - Gets the status of the DSC extension handler for a virtual machine. - - - - - Get - AzureRmVMDscExtensionStatus - - - - The Get-AzureRmVMDscExtensionStatus cmdlet gets the status of the Desired State Configuration (DSC) extension handler for a virtual machine in a resource group. When a configuration is applied this cmdlet produces output consistent with the Start-DscConfiguration cmdlet. - - - - Get-AzureRmVMDscExtensionStatus - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the DSC extension status. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtensionStatus. Specify this parameter only if you changed the default name in the Set cmdlet or used a different resource name in a Resource Manager template. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine for which this cmdlet gets the DSC extension status. - - String - - String - - - none - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtensionStatus. Specify this parameter only if you changed the default name in the Set cmdlet or used a different resource name in a Resource Manager template. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Set-AzureRmVMDscExtension - - - - - - - - Get-AzureRmVMExtension - - Gets properties of Virtual Machine Extensions installed on a virtual machine. - - - - - Get - AzureRmVMExtension - - - - The Get-AzureRmVMExtension cmdlet gets properties of Virtual Machine Extensions installed on a virtual machine. Specify the name of an extension for which to get properties. To get only the instance view of an extension, specify the Status parameter. - - - - Get-AzureRmVMExtension - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets properties of an extension from the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies. - - String - - - Status - - Indicates that this cmdlet gets only the instance view of an extension. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet gets properties of an extension from the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies. - - String - - String - - - none - - - Status - - Indicates that this cmdlet gets only the instance view of an extension. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get properties of an extension -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" - - This command gets properties for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11. - - - - - - - - - - - - - - -------------------------- Example 2: Get instance view of an extension -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Status - - This command gets the instance view for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11. - - - - - - - - - - - - - - - - Remove-AzureRmVMExtension - - - - Set-AzureRmVMExtension - - - - - - - - Get-AzureRmVMExtensionImage - - Gets all versions for an Azure extension. - - - - - Get - AzureRmVMExtensionImage - - - - The Get-AzureRmVMExtensionImage cmdlet gets all versions for an Azure extension. - - - - Get-AzureRmVMExtensionImage - - Location - - Specifies the location of an extension. - - String - - - PublisherName - - Specifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - Type - - Specifies the type of the extension. To obtain an extension type, use the Get-AzureRmVMExtensionImageType cmdlet. - - String - - - FilterExpression - - Specifies a filter expression. - - String - - - Version - - Specifies the version of the extension that this cmdlet gets. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of an extension. - - String - - String - - - none - - - PublisherName - - Specifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - Type - - Specifies the type of the extension. To obtain an extension type, use the Get-AzureRmVMExtensionImageType cmdlet. - - String - - String - - - none - - - FilterExpression - - Specifies a filter expression. - - String - - String - - - none - - - Version - - Specifies the version of the extension that this cmdlet gets. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the versions of an extension image -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMExtensionImage -Location "Central US" -PublisherName "Fabrikam" -Type "FabrikamEndpointProtection" - - This command gets all the versions of the extension image for the specified location, publisher, and type. - - - - - - - - - - - - - - - - Get-AzureRmVMExtensionImageType - - - - Get-AzureRmVMImage - - - - Get-AzureRmVMImagePublisher - - - - - - - - Get-AzureRmVMExtensionImageType - - Gets the type of an Azure extension. - - - - - Get - AzureRmVMExtensionImageType - - - - The Get-AzureRmVMExtensionImageType cmdlet gets the type of an Azure extension. - - - - Get-AzureRmVMExtensionImageType - - Location - - Specifies the location of an extension. This cmdlet gets the type for an extension at the location that this parameter specifies. - - String - - - PublisherName - - Specifies the name of a publisher of an extension. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of an extension. This cmdlet gets the type for an extension at the location that this parameter specifies. - - String - - String - - - none - - - PublisherName - - Specifies the name of a publisher of an extension. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get an extension image type -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMExtensionImageType -Location "Central US" -PublisherName "Fabrikam" - - This command gets the extension image type for the specified publisher and location. - - - - - - - - - - - - - - - - Get-AzureRmVMExtensionImage - - - - Get-AzureRmVMImagePublisher - - - - - - - - Get-AzureRmVMImage - - Gets all the versions of a VMImage. - - - - - Get - AzureRmVMImage - - - - The Get-AzureRmVMImage cmdlet gets all the versions of a VMImage. - - - - Get-AzureRmVMImage - - Location - - Specifies the location of a VMImage. - - String - - - PublisherName - - Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - Offer - - Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - - Skus - - Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. - - String - - - FilterExpression - - Specifies a filter expression. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVMImage - - Location - - Specifies the location of a VMImage. - - String - - - PublisherName - - Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - Offer - - Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - - Skus - - Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. - - String - - - Version - - Specifies the version of the VMImage. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of a VMImage. - - String - - String - - - none - - - PublisherName - - Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - Offer - - Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - String - - - none - - - Skus - - Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. - - String - - String - - - none - - - FilterExpression - - Specifies a filter expression. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Version - - Specifies the version of the VMImage. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get VMImage objects -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMImage -Location "Central US" -PublisherName "Canonical" -Offer "UbuntuServer" -Skus "15.04-DAILY" - - This command gets all the versions of VMImage that match the specified values. - - - - - - - - - - - - - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageSku - - - - Save-AzureRmVMImage - - - - - - - - Get-AzureRmVMImageOffer - - Gets VMImage offer types. - - - - - Get - AzureRmVMImageOffer - - - - The Get-AzureRmVMImageOffer cmdlet gets the VMImage offer types. - - - - Get-AzureRmVMImageOffer - - Location - - Specifies the location of the VMImage. - - String - - - PublisherName - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of the VMImage. - - String - - String - - - none - - - PublisherName - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get offer types for a publisher -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMImageOffer -Location "Central US" -PublisherName "Fabrikam" - - This command gets the offer types for the specified publisher in the Central US region. - - - - - - - - - - - - - - - - Get-AzureRmVMImage - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageSku - - - - Save-AzureRmVMImage - - - - - - - - Get-AzureRmVMImagePublisher - - Gets the VMImage publishers. - - - - - Get - AzureRmVMImagePublisher - - - - The Get-AzureRmVMImagePublisher cmdlet gets the VMImage publishers. - - - - Get-AzureRmVMImagePublisher - - Location - - Specifies the location of the VMImage. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of the VMImage. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get VMImage publishers for a region -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMImagePublisher -Location "Central US" - - This command gets the publishers of VMImage instances for the Central US region within your Azure profile. - - - - - - - - - - - - - - - - Get-AzureRmVMImage - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImageSku - - - - Save-AzureRmVMImage - - - - - - - - Get-AzureRmVMImageSku - - Gets VMImage SKUs. - - - - - Get - AzureRmVMImageSku - - - - The Get-AzureRmVMImageSku cmdlet gets VMImage SKUs. - - - - Get-AzureRmVMImageSku - - Location - - Specifies the location of the VMImage. - - String - - - PublisherName - - Specifies the publisher of a VMImage. - - String - - - Offer - - Specifies the type of VMImage offer. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location of the VMImage. - - String - - String - - - none - - - PublisherName - - Specifies the publisher of a VMImage. - - String - - String - - - none - - - Offer - - Specifies the type of VMImage offer. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get VMImage SKUs -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMImageSku -Location "Central US" -PublisherName "Fabrikam" -Offer "LinuxServer" - - This command gets the SKUs for the specified publisher and offer. - - - - - - - - - - - - - - - - Get-AzureRmVMImage - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImagePublisher - - - - Save-AzureRmVMImage - - - - - - - - Get-AzureRmVMSize - - Gets available virtual machine sizes. - - - - - Get - AzureRmVMSize - - - - The Get-AzureRmVMSize cmdlet gets available virtual machine sizes. - - - - Get-AzureRmVMSize - - Location - - Specifies the location for which this cmdlet gets the available virtual machine sizes. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVMSize - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - AvailabilitySetName - - Specifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureRmVMSize - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location for which this cmdlet gets the available virtual machine sizes. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - AvailabilitySetName - - Specifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get virtual machine sizes for a location -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMSize -Location "Central US" - - This command gets the available sizes for virtual machines in the specified location. - - - - - - - - - - - - - - -------------------------- Example 2: Get sizes for an availability set -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -AvailabilitySetName "AvailabilitySet17" - - This command gets available sizes for virtual machines that you can deploy in the availability set named AvailabilitySet17. - - - - - - - - - - - - - - -------------------------- Example 3: Get sizes for an existing virtual machine -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -VMName "VirtualMachine12" - - This command gets available sizes for the existing virtual machine named VirtualMachine12. You can resize this virtual machine to the sizes that this command gets. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - - - - - Get-AzureRmVMSqlServerExtension - - - - - - - Get - AzureRmVMSqlServerExtension - - - - - - - - Get-AzureRmVMSqlServerExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Get-AzureRmVmss - - Gets the properties of a VMSS. - - - - - Get - AzureRmVmss - - - - The Get-AzureRmVmss cmdlet gets the model and instance view of a Virtual Machine Scale Set (VMSS). The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine. - - - - Get-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS. - - String - - - - Get-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS. - - String - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - - - Get-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS. - - String - - String - - - none - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the properties of a VMSS -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMSS001" - - This command gets the properties of the VMSS named VMSS001 that belongs to the resource group named Group001. Since the command does not specify the InstanceView switch parameter, the cmdlet gets the model view of the virtual machine. - - - - - - - - - - - - - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Set-AzureRmVmss - - - - Start-AzureRmVmss - - - - Stop-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Get-AzureRmVmssSku - - Gets the available SKUs for the VMSS. - - - - - Get - AzureRmVmssSku - - - - The Get-AzureRmVmssSku cmdlet gets the available SKUs for the Virtual Machine Scale Set (VMSS). - - - - Get-AzureRmVmssSku - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS. - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not produce any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get all available SKUs from the VMSS -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmssSku -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" - - This command gets all the available SKUs from the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - - - - - Get-AzureRmVmssVM - - Gets the properties of a VMSS virtual machine. - - - - - Get - AzureRmVmssVM - - - - The Get-AzureRmVmssVM cmdlet gets the model view and instance view of a Virtual Machine Scale Set (VMSS) virtual machine. The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine. - - - - Get-AzureRmVmssVM - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS. - - String - - - InstanceId - - Specifies the instance ID for which to get the model view. - - String - - - - Get-AzureRmVmssVM - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS. - - String - - - InstanceId - - Specifies the instance ID for which to get the model view. - - String - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - - - Get-AzureRmVmssVM - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the Resource Group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS. - - String - - String - - - none - - - InstanceId - - Specifies the instance ID for which to get the model view. - - String - - String - - - none - - - InstanceView - - Indicates that this cmdlet gets only the instance view of the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get the properties of a VMSS virtual machine -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmssVM -ResourceGroupName "Group001" -VMScaleSetName "VMSS001" - - This command gets the properties of the VMSS virtual machine named VMSS001 that belongs to the resource group named Group001. Since the command does not specify the InstanceView switch parameter, the cmdlet gets the model view of the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 2: Get the model view properties of a VMSS virtual machine -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmssVM -ResourceGroupName "Group002" -VMScaleSetName "VMSS004" -InstanceId $ID - - This command gets the properties of the VMSS virtual machine named VMSS004 that belongs to the resource group named Group002. The command gets the instance ID stored in the variable $ID for which to get the model view. - - - - - - - - - - - - - - -------------------------- Example 3: Get the instance view properties of a VMSS virtual machine -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVmssVM -InstanceView -ResourceGroupName $rgname -VMScaleSetName $vmssName -InstanceId $ID - - This command gets the properties of the VMSS virtual machine named VMSS004 that belongs to the resource group named Group002. Since the command specifies the InstanceView switch parameter, the cmdlet gets the instance view of the virtual machine. The command gets the instance ID stored in the variable $ID for which to get the instance view. - - - - - - - - - - - - - - - - Set-AzureRmVmssVM - - - - Get-AzureRmVmss - - - - - - - - Get-AzureRmVMUsage - - Gets the virtual machine core count usage for a location. - - - - - Get - AzureRmVMUsage - - - - The Get-AzureRmVMUsage cmdlet gets the virtual machine core count usage for a location. - - - - Get-AzureRmVMUsage - - Location - - Specifies the location for which this cmdlet gets virtual machine core count usage. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Specifies the location for which this cmdlet gets virtual machine core count usage. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get core count usage for a location -------------------------- - - PS C:\> - - PS C:\>Get-AzureRmVMUsage -Location "Central US" - - This command gets the virtual machine core count usage for the location Central US. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - - - - - New-AzureRmAvailabilitySet - - Creates an Azure availability set. - - - - - New - AzureRmAvailabilitySet - - - - The New-AzureRmAvailabilitySet cmdlet creates an Azure availability set. - - - - New-AzureRmAvailabilitySet - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies a name for the availability set. - - String - - - Location - - Specifies the location for the availability set. - - String - - - PlatformUpdateDomainCount - - Specifies the platform update domain count. - - Nullable`1[Int32] - - - PlatformFaultDomainCount - - Specifies the platform fault domain count. - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Name - - Specifies a name for the availability set. - - String - - String - - - none - - - Location - - Specifies the location for the availability set. - - String - - String - - - none - - - PlatformUpdateDomainCount - - Specifies the platform update domain count. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - PlatformFaultDomainCount - - Specifies the platform fault domain count. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create an availability set -------------------------- - - PS C:\> - - PS C:\>New-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -Location "West US" - - This command creates an availability set named AvailablitySet03 in the resource group named ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmAvailabilitySet - - - - Remove-AzureRmAvailabilitySet - - - - - - - - New-AzureRmContainerService - - Create a container service - - - - - New - AzureRmContainerService - - - - This cmdlet allows you to create a container service. It expects a container service object which can be created with New-AzureRmContainerServiceConfig cmdlet. - - - - New-AzureRmContainerService - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Resource Group to deploy the container service in. - - String - - - Name - - Name of the container service to be created. - - String - - - ContainerService - - Container service object created with New-AzureRmContainerServiceConfig cmdlet that contains the container service properties. - - ContainerService - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group to deploy the container service in. - - String - - String - - - - - - Name - - Name of the container service to be created. - - String - - String - - - - - - ContainerService - - Container service object created with New-AzureRmContainerServiceConfig cmdlet that contains the container service properties. - - ContainerService - - ContainerService - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $loc = 'australiasoutheast'; -New-AzureRMResourceGroup -Name $rgname -Location $loc -Force; +PS C:\> Add-AzureRmVmssSecret -VirtualMachineScaleSet $VMSS -SourceVaultId $Vault.ResourceId -VaultCertificate $CertConfig +This example adds a secret to the VMSS. The first command uses the Get-AzureRmKeyVault cmdlet to get a vault secret from the vault named ContosoVault and stores the result in the variable named $Vault. The second command uses the New-AzureRmVmssVaultCertificateConfig cmdlet to create a Key Vault certificate configuration using the specified certificate URL from the certificate store named Certificates and stores the results in the variable named $CertConfig. The third command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The fourth command adds a secret to the VMSS using the vault secret using the key resource ID and the vault certificate stored in the $Vault and $CertConfig variables. New-AzureRmVmssVaultCertificateConfigNew-AzureRmVmssConfigAdd-AzureRmVmssSshPublicKeyAdds SSH public keys to the VMSS.AddAzureRmVmssSshPublicKeyThe Add-AzureRmVmssSshPublicKey cmdlet adds the public keys that you can use to connect to the Virtual Machine Scale Set (VMSS) virtual machines over Secure Shell (SSH).Add-AzureRmVmssSshPublicKeyVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. VirtualMachineScaleSetPathSpecifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file.StringKeyDataSpecifies a SSH RSA public key data.StringKeyDataSpecifies a SSH RSA public key data.StringStringnonePathSpecifies the full path of a file, on the virtual machine, where this cmdlet stores the SSH public key. If the file already exists, this cmdlet appends the key to the file.StringStringnoneVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output.Example 1: Add an SSH public key to the VMSSPS C:\>$VMSS = New-AzureRmVmssConfig +PS C:\> Add-AzureRmVmssSshPublicKey -VirtualMachineScaleSet $VMSS -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys" +This example adds an SSH public key to the VMSS.The first command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command adds an SSH key with the specified key data and stores the key at the specified path on the virtual machine.New-AzureRmVmssConfigAdd-AzureRmVmssWinRMListenerAdds a WinRM listener to the VMSS.AddAzureRmVmssWinRMListenerThe Add-AzureRmVmssWinRMListener cmdlet adds a Windows Remote Management (WinRM) listener on the Virtual Machine Scale Set (VMSS).Add-AzureRmVmssWinRMListenerVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetProtocolSpecifies the protocol of the WinRM listener. The acceptable values for this parameter are: + +-- Http +-- HttpsProtocolTypes]CertificateUrlSpecifies a link, as a URL, of the certificate with which new virtual machines are provisioned.StringCertificateUrlSpecifies a link, as a URL, of the certificate with which new virtual machines are provisioned.StringStringnoneProtocolSpecifies the protocol of the WinRM listener. The acceptable values for this parameter are: + +-- Http +-- HttpsProtocolTypes]ProtocolTypes]noneVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output.Example 1: Add a WinRM listener to the VMSSPS C:\>$VMSS = New-AzureRmVmssConfig +PS C:\> Add-AzureRmVmssWinRMListener -VirtualMachineScaleSet $VMSS -Protocol Https -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" +This example adds a WinRM listener to the VMSS.The first command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command adds an HTTP protocol WinRM listener with the certificate at the specified URL to the VMSS.New-AzureRmVmssConfigDisable-AzureRmVMDiskEncryptionDisables encryption on an IaaS virtual machine.DisableAzureRmVMDiskEncryptionThe Disable-AzureRmVMDiskEncryption cmdlet disables encryption on an infrastructure as a service (IaaS) virtual machine. This cmdlet installs an extension on the virtual machine to disable encryption. If the Name parameter is not specified, extension with the name "AzureDiskEncryption/AzureDiskEncryptionForLinux" (depending on the OS) is used. Caution: This cmdlet reboots the virtual machine.On Linux IaaS VMs, Disable-AzureRMVMDiskEncryption is not supported for VolumeType "OS".Disable-AzureRmVMDiskEncryptionResourceGroupNameSpecifies the resource group name of the virtual machine.StringVMNameSpecifies the name of the virtual machine that this cmdlet disables encryption on.StringVolumeTypeSpecifies the type of virtual machine volumes to perform the encryption operation. For Windows virtual machines, valid values are: + +-- All +-- OS +-- Data. If you do not specify a value for this parameter, the default value is All. Disable encryption is not currently supported for Linux. OSDataAllNameSpecifes the name of the Azure Resource Manager (ARM) resource that represents the extension. If this parameter is not specified, this cmdlet defaults to "AzureDiskEncryption for Windows VMs".StringTypeHandlerVersionSpecifies the version of the encryption extension. If you do not specify a value for this parameter, the latest version of the extension is used.StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.ForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.DisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.SwitchParameterSwitchParameternoneForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifes the name of the Azure Resource Manager (ARM) resource that represents the extension. If this parameter is not specified, this cmdlet defaults to "AzureDiskEncryption for Windows VMs".StringStringnoneResourceGroupNameSpecifies the resource group name of the virtual machine.StringStringnoneTypeHandlerVersionSpecifies the version of the encryption extension. If you do not specify a value for this parameter, the latest version of the extension is used.StringStringnoneVMNameSpecifies the name of the virtual machine that this cmdlet disables encryption on.StringStringnoneVolumeTypeSpecifies the type of virtual machine volumes to perform the encryption operation. For Windows virtual machines, valid values are: + +-- All +-- OS +-- Data. If you do not specify a value for this parameter, the default value is All. Disable encryption is not currently supported for Linux. StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseThis cmdlet does not generate any output.Example 1: Disable encryption for all volumes on a Windows virtual machinePS C:\>Disable-AzureRMVMDiskEncryption -ResourceGroupName "Group001" -VMName "VM002" +This command disables encryption for volumes of type all for the virtual machine named VM002 that belongs to the resource group named Group001. Since the VolumeType parameter is not specified, the cmdlet sets the value to All.Example 2: Disable encryption for data volumes on a Windows virtual machinePS C:\>$ResourceGroup = "Group002"; +PS C:\> $VMName = "VM004"; +PS C:\> Disable-AzureRMVMDiskEncryption -ResourceGroupName "Group002" -VMName "VM004" -VolumeType "Data" +This command disables encryption for volumes of type data for the virtual machine named VM004 that belongs to the resource group named Group002.Get-AzureRmVMDiskEncryptionStatusRemove-AzureRmVMDiskEncryptionExtensionSet-AzureRmVMDiskEncryptionExtensionGet-AzureRmAvailabilitySetGets Azure availability sets in a resource group.GetAzureRmAvailabilitySetThe Get-AzureRmAvailabilitySet cmdlet gets Azure availability sets in a resource group. You can specify the name of a specific availability set to get. Get-AzureRmAvailabilitySetResourceGroupNameSpecifies the name of a resource group. StringNameSpecifies the name of an availability set that this cmdlet gets.StringNameSpecifies the name of an availability set that this cmdlet gets.StringStringnoneResourceGroupNameSpecifies the name of a resource group. StringStringnoneExample 1: Get a specific availability setPS C:\>Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +This command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11. Example 2: Get all availability setsPS C:\>Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" +This command gets all the availability sets in the resource group named ResourceGroup11. New-AzureRmAvailabilitySetRemove-AzureRmAvailabilitySetGet-AzureRmContainerServiceGets a container service.GetAzureRmContainerServiceThe Get-AzureRmContainerService cmdlet gets a container service. You can view the properties of a container service, which include state, number of master and agents, and fully qualified domain name of master and agent.Get-AzureRmContainerServiceResourceGroupNameSpecifies the resource group of the container service that this cmdlet gets. StringNameSpecifies the name of the container service that this cmdlet gets.StringNameSpecifies the name of the container service that this cmdlet gets.StringStringnoneResourceGroupNameSpecifies the resource group of the container service that this cmdlet gets. StringStringnoneExample 1: Get a container servicePS C:\>Get-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" +This command gets a container service named CSResourceGroup17. New-AzureRmContainerServiceRemove-AzureRmContainerServiceUpdate-AzureRmContainerServiceGet-AzureRmRemoteDesktopFileGets an .rdp file.GetAzureRmRemoteDesktopFileThe Get-AzureRmRemoteDesktopFile cmdlet gets a Remote Desktop Protocol (.rdp) file.Get-AzureRmRemoteDesktopFileResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the availability set that this cmdlet gets.StringLocalPathSpecifies the local full path where this cmdlet stores the .rdp file. StringLaunchIndicates that this cmdlet launches Remote Desktop after it gets the .rdp file.Get-AzureRmRemoteDesktopFileResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the availability set that this cmdlet gets.StringLocalPathSpecifies the local full path where this cmdlet stores the .rdp file. StringLaunchIndicates that this cmdlet launches Remote Desktop after it gets the .rdp file.SwitchParameterSwitchParameternoneLocalPathSpecifies the local full path where this cmdlet stores the .rdp file. StringStringnoneNameSpecifies the name of the availability set that this cmdlet gets.StringStringnoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneExample 1: Get a Remote Desktop filePS C:\>Get-AzureRmRemoteDesktopFile -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -LocalPath "D:\RemoteDesktopFile07.rdp" +This command gets the Remote Desktop file for the virtual machine named VirtualMachine07. The command stores the result in the file named D:\RemoteDesktopFile07.rdp.Get-AzureRmVMAccessExtensionGets information about the VMAccess extension.GetAzureRmVMAccessExtensionThe Get-AzureRmVMAccessExtension cmdlet gets information about the Virtual Machine Access (VMAccess) Virtual Machine Extension.Get-AzureRmVMAccessExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet gets information about VMAccess for the virtual machine that this parameter specifies.StringNameSpecifies the name of the extension that this cmdlet gets.StringStatusIndicates that this cmdlet gets only the instance view of the extension.NameSpecifies the name of the extension that this cmdlet gets.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStatusIndicates that this cmdlet gets only the instance view of the extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine. This cmdlet gets information about VMAccess for the virtual machine that this parameter specifies.StringStringnoneExample 1: Get the VMAccess extensionPS C:\>$VMAccessExtension = Get-AzureRmVMAccessExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoTest" +This command gets the VMAccess extension named ContosoTest for the virtual machine named VirtualMachine07.Example 2: Get the instance view of the VMAccess extension PS C:\>$VMAccessExtension = Get-AzureRmVMAccessExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoTest" -Status +This command gets the instance view of the VMAccess extension named ContosoTest for the virtual machine named VirtualMachine07.Remove-AzureRmVMAccessExtensionSet-AzureRmVMAccessExtensionGet-AzureRmVMExtensionGet-AzureRmVMADDomainExtensionGets information about an AD domain extension.GetAzureRmVMADDomainExtensionThe Get-AzureRmVMADDomainExtension cmdlet gets information about the specified Azure Active Directory (AD) domain extension.Get-AzureRmVMADDomainExtensionResourceGroupNameSpecifies the name of a resource group.StringVMNameSpecifies the name of the virtual machine.StringNameSpecifies the name of the domain extension.StringStatusIndicates that this cmdlet gets the instance view of the domain extension.NameSpecifies the name of the domain extension.StringStringnoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneStatusIndicates that this cmdlet gets the instance view of the domain extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of the virtual machine.StringStringnone 1: Set-AzureRmVMADDomainExtensionGet-AzureRmVMAEMExtensionGets information about the AEM extension.GetAzureRmVMAEMExtensionThe Get-AzureRmVMAEMExtension cmdlet gets information about the Azure Enhanced Monitoring (AEM) extension.Get-AzureRmVMAEMExtensionResourceGroupNameSpecifies the name of the resource group of a virtual machine. This cmdlet gets information for the AEM extension on that virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet gets information about AEM extension for the virtual machine that this parameter specifies.StringNameSpecifies the name of a virtual machine. This cmdlet gets information for the AEM extension on the virtual machine that this cmdlet specifies. StringStatusIndicates that this cmdlet gets only the instance view of the AEM extension.OSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux.StringNameSpecifies the name of a virtual machine. This cmdlet gets information for the AEM extension on the virtual machine that this cmdlet specifies. StringStringnoneOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux.StringStringnoneResourceGroupNameSpecifies the name of the resource group of a virtual machine. This cmdlet gets information for the AEM extension on that virtual machine.StringStringnoneStatusIndicates that this cmdlet gets only the instance view of the AEM extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine. This cmdlet gets information about AEM extension for the virtual machine that this parameter specifies.StringStringnoneExample 1: Get the AEM extensionPS C:\>Get-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" +This command gets information for the AEM extension for the virtual machine named contoso-server.Remove-AzureRmVMAEMExtensionSet-AzureRmVMAEMExtensionTest-AzureRmVMAEMExtensionGet-AzureRmVMBootDiagnosticsDataGets boot diagnostics data for a virtual machine. GetAzureRmVMBootDiagnosticsDataThe Get-AzureRmVMBootDiagnosticsData cmdlet gets boot diagnostics data for a virtual machine. Get-AzureRmVMBootDiagnosticsDataResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine for which this cmdlet gets diagnostics data. StringLinuxIndicates that the virtual machine runs the Linux operating system. LocalPathSpecifies the local path for the boot diagnostics data. StringGet-AzureRmVMBootDiagnosticsDataResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine for which this cmdlet gets diagnostics data. StringWindowsIndicates that the virtual machine runs the Windows operating system.LocalPathSpecifies the local path for the boot diagnostics data. StringLinuxIndicates that the virtual machine runs the Linux operating system. SwitchParameterSwitchParameternoneLocalPathSpecifies the local path for the boot diagnostics data. StringStringnoneNameSpecifies the name of the virtual machine for which this cmdlet gets diagnostics data. StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneWindowsIndicates that the virtual machine runs the Windows operating system.SwitchParameterSwitchParameternoneExample 1: Get boot diagnostics dataPS C:\>Get-AzureRmVMBootDiagnosticsData -ResourceGroupName "ResourceGroup11" -Name "ContosoVM07" -Windows -LocalPath "C:\Contoso\BootDiagnostics" +This command gets boot diagnostics data for the virtual machine named ContosoVM07. This virtual machine runs the Windows operating system. The command stores the data in specified local path.Set-AzureRmVMBootDiagnosticsGet-AzureRmVMChefExtensionGets information about a Chef extension.GetAzureRmVMChefExtensionThe Get-AzureVMChefExtension cmdlet gets information about a Chef extension installed on a virtual machine.Get-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringVMNameSpecifies the name of a virtual machine.StringNameSpecifies the name of the Chef extension.StringStatusIndicates that this cmdlet gets only the instance view of the Chef extension.LinuxIndicates that this cmdlet works on a Linux virtual machine.Get-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringVMNameSpecifies the name of a virtual machine.StringNameSpecifies the name of the Chef extension.StringStatusIndicates that this cmdlet gets only the instance view of the Chef extension.WindowsIndicates that this cmdlet is for a Windows virtual machine.LinuxIndicates that this cmdlet works on a Linux virtual machine.SwitchParameterSwitchParameternoneNameSpecifies the name of the Chef extension.StringStringnoneResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringStringnoneStatusIndicates that this cmdlet gets only the instance view of the Chef extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine.StringStringnoneWindowsIndicates that this cmdlet is for a Windows virtual machine.SwitchParameterSwitchParameternoneExample 1: Get the details of Chef extension for a Windows virtual machine-PS C:\>Get-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup001" -VMName "WindowsVM001" -Windows +This command gets the Chef extension from a Windows virtual machine named WindowsVM001 that belongs to the resource group named ResourceGroup001.Example 2: Get the details of Chef extension for a Linux virtual machinePS C:\>Get-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup002" -VMName "LinuxVM001" -Linux +This command gets the Chef extension from a Linux virtual machine named LinuxVM001 that belongs to the resource group named ResourceGroup002.Set-AzureRmVMChefExtensionRemove-AzureRmVMChefExtensionGet-AzureRmVMCustomScriptExtensionGets information about a custom script extension.GetAzureRmVMCustomScriptExtensionThe Get-AzureRmVMCustomScriptExtension cmdlet gets information about a custom script Virtual Machine Extension on a virtual machine. Get-AzureRmVMCustomScriptExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.System.StringVMNameSpecifies the name of a virtual machine for which this cmdlet gets the custom script extension.System.StringNameSpecifies the name of the custom script extension about which this cmdlet gets information. System.StringStatusIndicates that this cmdlet gets the instance view of the custom script extension.NameSpecifies the name of the custom script extension about which this cmdlet gets information. System.StringSystem.StringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.System.StringSystem.StringnoneStatusIndicates that this cmdlet gets the instance view of the custom script extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine for which this cmdlet gets the custom script extension.System.StringSystem.StringnoneExample 1: Get a custom script extensionPS C:\>$VMCustomScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoCustomScript" +This command gets the custom script extension named ContosoCustomScript for the virtual machine named VirtualMachine07.Example 2: Get the instance view of a custom script extensionPS C:\>$VMCustomScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -Name "ContosoCustomScript" -Status +This command gets the instance view of the custom script extension named ContosoCustomScript for the virtual machine named VirtualMachine07. Get-AzureRmVMAccessExtensionGet-AzureRmVMExtensionGet-AzureRmVMExtensionImageGet-AzureRMVMDiagnosticsExtensionGets the settings of the Diagnostics extension on a virtual machine.GetAzureRMVMDiagnosticsExtensionThe Get-AzureRmVMDiagnosticsExtension cmdlet gets the settings of the Azure Diagnostics extension on a virtual machine.Get-AzureRMVMDiagnosticsExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine from which this cmdlet gets the Diagnostics extension.StringNameSpecifies the name of the Diagnostics extension for which this cmdlet gets settings.StringStatusIndicates that this cmdlet uses the Status value.NameSpecifies the name of the Diagnostics extension for which this cmdlet gets settings.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStatusIndicates that this cmdlet uses the Status value.SwitchParameterSwitchParameternoneVMNameSpecifies the name of the virtual machine from which this cmdlet gets the Diagnostics extension.StringStringnoneExample 1: Get the diagnostics extension applied to a virtual machinePS C:\>Get-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM22" +This command gets the diagnostics extension applied to the virtual machine named ContosoVM22. Remove-AzureRmVMDiagnosticsExtensionSet-AzureRmVMDiagnosticsExtensionGet-AzureRmVMDiskEncryptionStatusGets the encryption status of the virtual machine.GetAzureRmVMDiskEncryptionStatusThe Get-AzureRmVMDiskEncryptionStatus cmdlet gets the encryption status of the virtual machine. It displays the encryption status of the operating system and data volumes. In addition to encryption status, it also displays the encryption secret URL, key encryption key URL, resource IDs of the KeyVaults where the encryption key and key encryption key for operating system volume are present.For more details on the encryption status, refer to https://gallery.technet.microsoft.com/Azure-Disk-Encryption-for-a0018eb0Get-AzureRmVMDiskEncryptionStatusResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine.StringResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine.StringStringnoneOn some versions of Linux, the encryption status is reported as "Unknown". This is caused by an issue in Linux Agent. The correct status shall be shown once the Linux distribution consumes the updated Linux Agent. Refer to https://github.com/Azure/WALinuxAgent/issues/388 for technical details.Example 1: Get the encryption status of a virtual machinePS C:\>Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName "MyResourceGroup001" -VMName "VM001" +This command gets the encryption status of the virtual machine named VM001.Remove-AzureRmVMDiskEncryptionExtensionSet-AzureRmVMDiskEncryptionExtensionGet-AzureRmVMDscExtensionStatusGets the status of the DSC extension handler for a virtual machine.GetAzureRmVMDscExtensionStatusThe Get-AzureRmVMDscExtensionStatus cmdlet gets the status of the Desired State Configuration (DSC) extension handler for a virtual machine in a resource group. When a configuration is applied this cmdlet produces output consistent with the Start-DscConfiguration cmdlet.Get-AzureRmVMDscExtensionStatusResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine for which this cmdlet gets the DSC extension status.StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtensionStatus. Specify this parameter only if you changed the default name in the Set cmdlet or used a different resource name in a Resource Manager template.StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtensionStatus. Specify this parameter only if you changed the default name in the Set cmdlet or used a different resource name in a Resource Manager template.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine for which this cmdlet gets the DSC extension status.StringStringnone 1: Set-AzureRmVMDscExtensionGet-AzureRmVMDscExtensionGets the settings of the DSC extension on a particular virtual machine.GetAzureRmVMDscExtensionThe Get-AzureRmVMDscExtension cmdlet gets the settings of the Desired State Configuration (DSC) extension on a particular virtual machine.Get-AzureRmVMDscExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine for which this cmdlet gets the DSC extension.StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed the default name in the Set-AzureRmVMDscExtension cmdlet or used a different resource name in a Resource Manager template.StringStatusIndicates that this cmdlet gets the instance view of the DSC extension.NameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the same value that is used by Get-AzureRmVMDscExtension. Specify this parameter only if you changed the default name in the Set-AzureRmVMDscExtension cmdlet or used a different resource name in a Resource Manager template.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStatusIndicates that this cmdlet gets the instance view of the DSC extension.SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine for which this cmdlet gets the DSC extension.StringStringnoneMicrosoft.Azure.Commands.Compute.Extension.DSC.VirtualMachineDscExtensionContextExample 1: Get the settings of a DSC extensionPS C:\>Get-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup002" -VMName "VM07" -Name "DSC" +This command gets the settings of extension named DSC on the virtual machine named VM07.Remove-AzureRmVMDscExtensionSet-AzureRmVMDscExtensionGet-AzureRmVMExtensionImageTypeGets the type of an Azure extension.GetAzureRmVMExtensionImageTypeThe Get-AzureRmVMExtensionImageType cmdlet gets the type of an Azure extension.Get-AzureRmVMExtensionImageTypeLocationSpecifies the location of an extension. This cmdlet gets the type for an extension at the location that this parameter specifies. StringPublisherNameSpecifies the name of a publisher of an extension. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies.StringLocationSpecifies the location of an extension. This cmdlet gets the type for an extension at the location that this parameter specifies. StringStringnonePublisherNameSpecifies the name of a publisher of an extension. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies.StringStringnoneExample 1: Get an extension image typePS C:\>Get-AzureRmVMExtensionImageType -Location "Central US" -PublisherName "Fabrikam" +This command gets the extension image type for the specified publisher and location. Get-AzureRmVMExtensionImageGet-AzureRmVMImagePublisherGet-AzureRmVMExtensionImageGets all versions for an Azure extension.GetAzureRmVMExtensionImageThe Get-AzureRmVMExtensionImage cmdlet gets all versions for an Azure extension.Get-AzureRmVMExtensionImageFilterExpressionSpecifies a filter expression.StringVersionSpecifies the version of the extension that this cmdlet gets.StringLocationSpecifies the location of an extension.StringPublisherNameSpecifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringTypeSpecifies the type of the extension. To obtain an extension type, use the Get-AzureRmVMExtensionImageType cmdlet.StringFilterExpressionSpecifies a filter expression.StringStringnoneLocationSpecifies the location of an extension.StringStringnonePublisherNameSpecifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringStringnoneTypeSpecifies the type of the extension. To obtain an extension type, use the Get-AzureRmVMExtensionImageType cmdlet.StringStringnoneVersionSpecifies the version of the extension that this cmdlet gets.StringStringnoneExample 1: Get the versions of an extension imagePS C:\>Get-AzureRmVMExtensionImage -Location "Central US" -PublisherName "Fabrikam" -Type "FabrikamEndpointProtection" +This command gets all the versions of the extension image for the specified location, publisher, and type. Get-AzureRmVMExtensionImageTypeGet-AzureRmVMImageGet-AzureRmVMImagePublisherGet-AzureRmVMExtensionGets properties of Virtual Machine Extensions installed on a virtual machine.GetAzureRmVMExtensionThe Get-AzureRmVMExtension cmdlet gets properties of Virtual Machine Extensions installed on a virtual machine. Specify the name of an extension for which to get properties. To get only the instance view of an extension, specify the Status parameter.Get-AzureRmVMExtensionResourceGroupNameSpecifies the name of a resource group. StringVMNameSpecifies the name of a virtual machine. This cmdlet gets properties of an extension from the virtual machine that this parameter specifies. StringNameSpecifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies. StringStatusIndicates that this cmdlet gets only the instance view of an extension. NameSpecifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies. StringStringnoneResourceGroupNameSpecifies the name of a resource group. StringStringnoneStatusIndicates that this cmdlet gets only the instance view of an extension. SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine. This cmdlet gets properties of an extension from the virtual machine that this parameter specifies. StringStringnoneExample 1: Get properties of an extensionPS C:\>Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" +This command gets properties for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11.Example 2: Get instance view of an extensionPS C:\>Get-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Status +This command gets the instance view for the extension named CustomScriptExtension on the virtual machine named VirtualMachine22 in the resource group ResourceGroup11. Remove-AzureRmVMExtensionSet-AzureRmVMExtensionGet-AzureRmVMImageOfferGets VMImage offer types.GetAzureRmVMImageOfferThe Get-AzureRmVMImageOffer cmdlet gets the VMImage offer types.Get-AzureRmVMImageOfferLocationSpecifies the location of the VMImage.StringPublisherNameSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringLocationSpecifies the location of the VMImage.StringStringnonePublisherNameSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringStringnoneExample 1: Get offer types for a publisherPS C:\>Get-AzureRmVMImageOffer -Location "Central US" -PublisherName "Fabrikam" +This command gets the offer types for the specified publisher in the Central US region.Get-AzureRmVMImageGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuSave-AzureRmVMImageGet-AzureRmVMImagePublisherGets the VMImage publishers.GetAzureRmVMImagePublisherThe Get-AzureRmVMImagePublisher cmdlet gets the VMImage publishers.Get-AzureRmVMImagePublisherLocationSpecifies the location of the VMImage. StringLocationSpecifies the location of the VMImage. StringStringnoneExample 1: Get VMImage publishers for a regionPS C:\>Get-AzureRmVMImagePublisher -Location "Central US" +This command gets the publishers of VMImage instances for the Central US region within your Azure profile.Get-AzureRmVMImageGet-AzureRmVMImageOfferGet-AzureRmVMImageSkuSave-AzureRmVMImageGet-AzureRmVMImageSkuGets VMImage SKUs.GetAzureRmVMImageSkuThe Get-AzureRmVMImageSku cmdlet gets VMImage SKUs.Get-AzureRmVMImageSkuLocationSpecifies the location of the VMImage. StringOfferSpecifies the type of VMImage offer. StringPublisherNameSpecifies the publisher of a VMImage. StringLocationSpecifies the location of the VMImage. StringStringnoneOfferSpecifies the type of VMImage offer. StringStringnonePublisherNameSpecifies the publisher of a VMImage. StringStringnoneExample 1: Get VMImage SKUsPS C:\>Get-AzureRmVMImageSku -Location "Central US" -PublisherName "Fabrikam" -Offer "LinuxServer" +This command gets the SKUs for the specified publisher and offer.Get-AzureRmVMImageGet-AzureRmVMImageOfferGet-AzureRmVMImagePublisherSave-AzureRmVMImageGet-AzureRmVMImageGets all the versions of a VMImage.GetAzureRmVMImageThe Get-AzureRmVMImage cmdlet gets all the versions of a VMImage.Get-AzureRmVMImageFilterExpressionSpecifies a filter expression.StringLocationSpecifies the location of a VMImage.StringOfferSpecifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringPublisherNameSpecifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringSkusSpecifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. StringGet-AzureRmVMImageLocationSpecifies the location of a VMImage.StringOfferSpecifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringPublisherNameSpecifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringSkusSpecifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. StringVersionSpecifies the version of the VMImage.StringFilterExpressionSpecifies a filter expression.StringStringnoneLocationSpecifies the location of a VMImage.StringStringnoneOfferSpecifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringStringnonePublisherNameSpecifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringStringnoneSkusSpecifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet. StringStringnoneVersionSpecifies the version of the VMImage.StringStringnoneExample 1: Get VMImage objectsPS C:\>Get-AzureRmVMImage -Location "Central US" -PublisherName "Canonical" -Offer "UbuntuServer" -Skus "15.04-DAILY" +This command gets all the versions of VMImage that match the specified values. Get-AzureRmVMImageOfferGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuSave-AzureRmVMImageGet-AzureRmVMSizeGets available virtual machine sizes.GetAzureRmVMSizeThe Get-AzureRmVMSize cmdlet gets available virtual machine sizes.Get-AzureRmVMSizeResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringAvailabilitySetNameSpecifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes.StringGet-AzureRmVMSizeLocationSpecifies the location for which this cmdlet gets the available virtual machine sizes.StringGet-AzureRmVMSizeResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing.StringAvailabilitySetNameSpecifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes.StringStringnoneLocationSpecifies the location for which this cmdlet gets the available virtual machine sizes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing.StringStringnoneExample 1: Get virtual machine sizes for a locationPS C:\>Get-AzureRmVMSize -Location "Central US" +This command gets the available sizes for virtual machines in the specified location. Example 2: Get sizes for an availability setPS C:\>Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -AvailabilitySetName "AvailabilitySet17" +This command gets available sizes for virtual machines that you can deploy in the availability set named AvailabilitySet17. Example 3: Get sizes for an existing virtual machinePS C:\>Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -VMName "VirtualMachine12" +This command gets available sizes for the existing virtual machine named VirtualMachine12. You can resize this virtual machine to the sizes that this command gets. Get-AzureRmVMGet-AzureRMVMSqlServerExtensionGets the settings for a SQL Server extension on a virtual machine.GetAzureRMVMSqlServerExtensionThe Get-AzureRmVMSqlServerExtension cmdlet gets the settings of the SQL Server infrastructure as a service (IaaS) Agent on a virtual machine.Get-AzureRMVMSqlServerExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine.StringNameSpecifies the name of the SQL Server the extension. StringNameSpecifies the name of the SQL Server the extension. StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine.StringStringnoneExample 1: Get the settings of a SQL Server extension on a virtual machinePS C:\>Get-AzureRmVMSqlServerExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM07" +ExtensionName : SqlIaaSAgent +Publisher : Microsoft.SqlServer.Management +Version : 1.0 +State : Enable +RoleName : VMName +AutoPatchingSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoPatchingSettings +AutoBackupSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoBackupSettings +This command gets the settings of the SQL Server extension on a virtual machine named ContosoVM07.Example 2: Get the settings by using the pipelinePS C:\>Get-AzureRmVM -ServiceName "Service08" -Name "ContosoVM22" | Get-AzureRmVMSqlServerExtension +ExtensionName : SqlIaaSAgent +Publisher : Microsoft.SqlServer.Management +Version : 1.0 +State : Enable +RoleName : VMName +AutoPatchingSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoPatchingSettings +AutoBackupSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoBackupSettings +This command gets the virtual machine named ContosoVM22 on the service Service08 by using the Get-AzureRmVM cmdlet. The command passes the results to the current cmdlet by using the pipeline operator. The current command gets the settings of the SQL Server IaaS Agent on that virtual machine.Example 3: Get the settings of specific SQL Server version PS C:\>Get-AzureRmVMSqlServerExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM07" -Version "1.0" +ExtensionName : SqlIaaSAgent +Publisher : Microsoft.SqlServer.Management +Version : 1.0 +State : Enable +RoleName : VMName +AutoPatchingSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoPatchingSettings +AutoBackupSettings : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoBackupSettings +This command gets the settings of version 1.0 of the SQL Server extension on a virtual machine named ContosoVM07. Get-AzureRmVMRemove-AzureRmVMSqlServerExtensionSet-AzureRmVMSqlServerExtensionGet-AzureRmVmssSkuGets the available SKUs for the VMSS.GetAzureRmVmssSkuThe Get-AzureRmVmssSku cmdlet gets the available SKUs for the Virtual Machine Scale Set (VMSS).Get-AzureRmVmssSkuResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS.StringResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVMScaleSetNameSpecies the name of the VMSS.StringStringnoneThis cmdlet does not produce any output.Example 1: Get all available SKUs from the VMSSPS C:\>Get-AzureRmVmssSku -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" +This command gets all the available SKUs from the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup.Get-AzureRmVmssGet-AzureRmVmssVMGets the properties of a VMSS virtual machine.GetAzureRmVmssVMThe Get-AzureRmVmssVM cmdlet gets the model view and instance view of a Virtual Machine Scale Set (VMSS) virtual machine. The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine.Get-AzureRmVmssVMResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS.StringInstanceIdSpecifies the instance ID for which to get the model view.StringGet-AzureRmVmssVMResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS.StringInstanceIdSpecifies the instance ID for which to get the model view.StringInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.Get-AzureRmVmssVMInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.InstanceIdSpecifies the instance ID for which to get the model view.StringStringnoneInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringStringnoneVMScaleSetNameSpecies the name of the VMSS.StringStringnoneThis cmdlet does not generate any output.Example 1: Get the properties of a VMSS virtual machinePS C:\>Get-AzureRmVmssVM -ResourceGroupName "Group001" -VMScaleSetName "VMSS001" +This command gets the properties of the VMSS virtual machine named VMSS001 that belongs to the resource group named Group001. Since the command does not specify the InstanceView switch parameter, the cmdlet gets the model view of the virtual machine.Example 2: Get the model view properties of a VMSS virtual machinePS C:\>Get-AzureRmVmssVM -ResourceGroupName "Group002" -VMScaleSetName "VMSS004" -InstanceId $ID +This command gets the properties of the VMSS virtual machine named VMSS004 that belongs to the resource group named Group002. The command gets the instance ID stored in the variable $ID for which to get the model view.Example 3: Get the instance view properties of a VMSS virtual machinePS C:\>Get-AzureRmVmssVM -InstanceView -ResourceGroupName $rgname -VMScaleSetName $vmssName -InstanceId $ID +This command gets the properties of the VMSS virtual machine named VMSS004 that belongs to the resource group named Group002. Since the command specifies the InstanceView switch parameter, the cmdlet gets the instance view of the virtual machine. The command gets the instance ID stored in the variable $ID for which to get the instance view.Set-AzureRmVmssVMGet-AzureRmVmssGet-AzureRmVmssGets the properties of a VMSS.GetAzureRmVmssThe Get-AzureRmVmss cmdlet gets the model and instance view of a Virtual Machine Scale Set (VMSS). The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine.Get-AzureRmVmssResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS.StringInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.Get-AzureRmVmssInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.Get-AzureRmVmssResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS.StringInstanceViewIndicates that this cmdlet gets only the instance view of the virtual machine.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the Resource Group of the VMSS.StringStringnoneVMScaleSetNameSpecies the name of the VMSS.StringStringnoneThis cmdlet does not generate any output.Example 1: Get the properties of a VMSSPS C:\>Get-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMSS001" +This command gets the properties of the VMSS named VMSS001 that belongs to the resource group named Group001. Since the command does not specify the InstanceView switch parameter, the cmdlet gets the model view of the virtual machine.New-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssGet-AzureRmVMUsageGets the virtual machine core count usage for a location. GetAzureRmVMUsageThe Get-AzureRmVMUsage cmdlet gets the virtual machine core count usage for a location.Get-AzureRmVMUsageLocationSpecifies the location for which this cmdlet gets virtual machine core count usage.StringLocationSpecifies the location for which this cmdlet gets virtual machine core count usage.StringStringnoneExample 1: Get core count usage for a locationPS C:\>Get-AzureRmVMUsage -Location "Central US" +This command gets the virtual machine core count usage for the location Central US.Get-AzureRmVMGet-AzureRmVMGets the properties of a virtual machine.GetAzureRmVMThe Get-AzureRmVM cmdlet gets the model view and instance view of an Azure virtual machine. The model view is the user specified properties of the virtual machine. The instance view is the instance level status of the virtual machine. Specify the Status parameter to get only the instance view of a virtual machine.Get-AzureRmVMResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the virtual machine to get.StringStatusIndicates that this cmdlet gets only the instance view of the virtual machine.Get-AzureRmVMNextLinkSpecifies the next link.UriGet-AzureRmVMResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the virtual machine to get.StringStringnoneNextLinkSpecifies the next link.UriUrinoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneStatusIndicates that this cmdlet gets only the instance view of the virtual machine.SwitchParameterSwitchParameternoneExample 1: Get model and instance view propertiesPS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +This command gets the model view and instance view properties of the virtual machine named VirtualMachine07. Example 2: Get instance view propertiesPS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Status +This command gets properties of the virtual machine named VirtualMachine07. This command specifies the Status parameter. Therefore, the command gets only the instance view properties.Example 3: Get properties for all virtual machines in a resource groupPS C:\>Get-AzureRmVM -ResourceGroupName "ResourceGroup11" +This command gets properties for all the virtual machines in the resource group named ResourceGroup11. Example 4: Get all virtual machines in your subscription PS C:\>Get-AzureRmVM +This command gets all the virtual machines in your subscription.New-AzureRmVMRemove-AzureRmVMRestart-AzureRmVMStart-AzureRmVMStop-AzureRmVMUpdate-AzureRmVMNew-AzureRmAvailabilitySetCreates an Azure availability set.NewAzureRmAvailabilitySetThe New-AzureRmAvailabilitySet cmdlet creates an Azure availability set.New-AzureRmAvailabilitySetResourceGroupNameSpecifies the name of a resource group. StringNameSpecifies a name for the availability set.StringLocationSpecifies the location for the availability set.StringPlatformUpdateDomainCountSpecifies the platform update domain count.Int32]PlatformFaultDomainCountSpecifies the platform fault domain count.Int32]LocationSpecifies the location for the availability set.StringStringnoneNameSpecifies a name for the availability set.StringStringnonePlatformFaultDomainCountSpecifies the platform fault domain count.Int32]Int32]nonePlatformUpdateDomainCountSpecifies the platform update domain count.Int32]Int32]noneResourceGroupNameSpecifies the name of a resource group. StringStringnoneExample 1: Create an availability setPS C:\>New-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -Location "West US" +This command creates an availability set named AvailablitySet03 in the resource group named ResourceGroup11. Get-AzureRmAvailabilitySetRemove-AzureRmAvailabilitySetNew-AzureRmContainerServiceConfigCreates a local configuration object for a container service.NewAzureRmContainerServiceConfigThe New-AzureRmContainerServiceConfig cmdlet creates a local configuration object for a container service. Provide this object to the New-AzureRmContainerService cmdlet to create a container service.New-AzureRmContainerServiceConfigLocationSpecifies the location in which to create the container service.StringSshPublicKeySpecifies the SSH public key for a Linux-based container service.String[]VmDiagnosticsEnabledIndicates whether this configuration enables diagnostics for the container service virtual machine.Boolean]TagSpecifies tags for the container service.HashtableOrchestratorTypeSpecifies the type of orchestrator for the container service. The acceptable values for this parameter are: DCOS and Swarm.ContainerServiceOchestratorTypes]MasterCountSpecifies the number of master virtual machines to create.Int32]MasterDnsPrefixSpecifies the DNS prefix for the master virtual machine.StringAgentPoolProfileSpecifies an array of agent pool profile objects for the container service. Add a profile by using the Add-AzureRmContainerServiceAgentPoolProfile cmdlet.ContainerServiceAgentPoolProfile[]WindowsProfileAdminUsernameSpecifies the administrator username for a container service that uses the Windows operating system. StringWindowsProfileAdminPasswordSpecifies the administrator password for a container service that uses the Windows operating system. StringAdminUsernameSpecifies the administrator account name to use for a Linux-based container service.StringAdminUsernameSpecifies the administrator account name to use for a Linux-based container service.StringStringnoneAgentPoolProfileSpecifies an array of agent pool profile objects for the container service. Add a profile by using the Add-AzureRmContainerServiceAgentPoolProfile cmdlet.ContainerServiceAgentPoolProfile[]ContainerServiceAgentPoolProfile[]noneLocationSpecifies the location in which to create the container service.StringStringnoneMasterCountSpecifies the number of master virtual machines to create.Int32]Int32]noneMasterDnsPrefixSpecifies the DNS prefix for the master virtual machine.StringStringnoneOrchestratorTypeSpecifies the type of orchestrator for the container service. The acceptable values for this parameter are: DCOS and Swarm.ContainerServiceOchestratorTypes]ContainerServiceOchestratorTypes]noneSshPublicKeySpecifies the SSH public key for a Linux-based container service.String[]String[]noneTagSpecifies tags for the container service.HashtableHashtablenoneVmDiagnosticsEnabledIndicates whether this configuration enables diagnostics for the container service virtual machine.Boolean]Boolean]noneWindowsProfileAdminPasswordSpecifies the administrator password for a container service that uses the Windows operating system. StringStringnoneWindowsProfileAdminUsernameSpecifies the administrator username for a container service that uses the Windows operating system. StringStringnoneExample 1: Create a container service configurationPS C:\>$Container = New-AzureRmContainerServiceConfig -Location "Australia Southeast" -OrchestratorType "DCOS" -MasterDnsPrefix "MasterResourceGroup17" -AdminUsername "AcsLinuxAdmin" -SshPublicKey "<ssh-key>" | Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" +This command creates a container, and then stores it in the $Container variable. The command specifies various settings for the container service configuration. The command passes the configuration object to the Add-AzureRmContainerServiceAgentPoolProfile cmdlet by using the pipeline operator. That cmdlet adds an agent pool profile.Specify the object in $Container for the ContainerService parameter of New-AzureRmContainerService.Add-AzureRmContainerServiceAgentPoolProfileNew-AzureRmContainerServiceNew-AzureRmContainerServiceCreates a container service.NewAzureRmContainerServiceThe New-AzureRmContainerService cmdlet creates a container service. Specify a container service object that you can create by using the New-AzureRmContainerServiceConfig cmdlet.New-AzureRmContainerServiceResourceGroupNameSpecifies the resource group in which this cmdlet deploys the container service.StringNameSpecifies the name of the container service that this cmdlet creates.StringContainerServiceSpecifies a container service object that contains the properties for the new service. To obtain a ContainerService object, use the New-AzureRmContainerServiceConfig cmdlet. ContainerServiceConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ContainerServiceSpecifies a container service object that contains the properties for the new service. To obtain a ContainerService object, use the New-AzureRmContainerServiceConfig cmdlet. ContainerServiceContainerServicenoneNameSpecifies the name of the container service that this cmdlet creates.StringStringnoneResourceGroupNameSpecifies the resource group in which this cmdlet deploys the container service.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Create a container servicePS C:\>New-AzureRMResourceGroup -Name "ResourceGroup17" -Location "Australia Southeast" -Force +PS C:\> $Container = New-AzureRmContainerServiceConfig -Location "Australia Southeast" -OrchestratorType "DCOS" -MasterDnsPrefix "MasterResourceGroup17" -AdminUsername "AcsLinuxAdmin" -SshPublicKey "<ssh-key>" | Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" +PS C:\> New-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" -ContainerService $Container +The first command creates a resource group named ResourceGroup17 at the specified location. For more information, see the New-AzureRmResourceGroup cmdlet.The second command creates a container, and then stores it in the $Container variable. For more information, see the New-AzureRmContainerServiceConfig cmdlet.The final command creates a container service for the container stored in $Container. The service is named csResourceGroup17. Get-AzureRmContainerServiceNew-AzureRmContainerServiceConfigRemove-AzureRmContainerServiceUpdate-AzureRmContainerServiceNew-AzureRmVMConfigCreates a configurable virtual machine object.NewAzureRmVMConfigThe New-AzureRmVMConfig cmdlet creates a configurable local virtual machine object for Azure. Other cmdlets can be used to configure a virtual machine object, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk.New-AzureRmVMConfigVMNameSpecifies a name for the virtual machine.StringVMSizeSpecifies the size for the virtual machine.StringAvailabilitySetIdSpecifies the ID of an availability set. To obtain an availability set object, use the Get-AzureRmAvailabilitySet cmdlet. The availability set object contains an ID property.StringAvailabilitySetIdSpecifies the ID of an availability set. To obtain an availability set object, use the Get-AzureRmAvailabilitySet cmdlet. The availability set object contains an ID property.StringStringnoneVMNameSpecifies a name for the virtual machine.StringStringnoneVMSizeSpecifies the size for the virtual machine.StringStringnoneExample 1: Create a virtual machine objectPS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet.Update-AzureRmVMSet-AzureRmVMOperatingSystemSet-AzureRmVMSourceImageGet-AzureRmAvailabilitySetNew-AzureRmVmssConfigCreates a VMSS configuration object.NewAzureRmVmssConfigThe New-AzureRmVmssConfig cmdlet creates a configurable local Virtual Manager Scale Set (VMSS) object. Other cmdlets are needed to configure the VMSS object. These cmdlets are:-- Set-AzureRmVmssOsProfile +-- Set-AzureRmVmssStorageProfile +-- Add-AzureRmVmssNetworkInterfaceConfiguration +-- Add-AzureRmVmssExtensionNew-AzureRmVmssConfigOverProvisionIndicates whether the cmdlet overprovisions the VMSS.Boolean]NetworkInterfaceConfigurationSpecifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet to add this object.VirtualMachineScaleSetNetworkConfiguration[]ExtensionSpecifies the extension information object for the VMSS. You can use the Add-AzureRmVmssExtension cmdlet to add this object.VirtualMachineScaleSetExtension[]LocationSpecifies the Azure location where the VMSS is created.StringTagSpecifies the tags that will be assigned to the VMSS.HashtableSkuNameSpecifies the size of all the instances of VMSS.StringSkuTierSpecifies the tier of VMSS.The acceptable values for this parameter are: + +-- Standard +-- BasicStringSkuCapacitySpecifies the number of instances in the VMSS.Int64]UpgradePolicyModeSpecified the mode of an upgrade to virtual machines in the scale set.The acceptable values for this parameter are: + +-- Automatic +-- ManualUpgradeMode]OsProfileSpecifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzureRmVmssOsProfile cmdlet to set this object.VirtualMachineScaleSetOSProfileStorageProfileSpecifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzureRmVmssStorageProfile cmdlet to set this object.VirtualMachineScaleSetStorageProfileExtensionSpecifies the extension information object for the VMSS. You can use the Add-AzureRmVmssExtension cmdlet to add this object.VirtualMachineScaleSetExtension[]VirtualMachineScaleSetExtension[]noneLocationSpecifies the Azure location where the VMSS is created.StringStringnoneNetworkInterfaceConfigurationSpecifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet to add this object.VirtualMachineScaleSetNetworkConfiguration[]VirtualMachineScaleSetNetworkConfiguration[]noneOsProfileSpecifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzureRmVmssOsProfile cmdlet to set this object.VirtualMachineScaleSetOSProfileVirtualMachineScaleSetOSProfilenoneOverProvisionIndicates whether the cmdlet overprovisions the VMSS.Boolean]Boolean]noneSkuCapacitySpecifies the number of instances in the VMSS.Int64]Int64]noneSkuNameSpecifies the size of all the instances of VMSS.StringStringnoneSkuTierSpecifies the tier of VMSS.The acceptable values for this parameter are: + +-- Standard +-- BasicStringStringnoneStorageProfileSpecifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzureRmVmssStorageProfile cmdlet to set this object.VirtualMachineScaleSetStorageProfileVirtualMachineScaleSetStorageProfilenoneTagSpecifies the tags that will be assigned to the VMSS.HashtableHashtablenoneUpgradePolicyModeSpecified the mode of an upgrade to virtual machines in the scale set.The acceptable values for this parameter are: + +-- Automatic +-- ManualUpgradeMode]UpgradeMode]noneThis cmdlet does not generate any output.Example 1: Create a VMSS configuration objectPS C:\>$VMSS = New-AzureRmVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic" -NetworkInterfaceConfiguration $NetCfg ` + | Add-AzureRmVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg ` + | Set-AzureRmVmssOSProfile -ComputerNamePrefix "Test" -AdminUsername $adminUsername -AdminPassword $AdminPassword ` + | Set-AzureRmVmssStorageProfile -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" ` + -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version ` + -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VHDContainer ` + | Add-AzureRmVmssAdditionalUnattendContent -ComponentName $AUCComponentName -Content $AUCContent -PassName $AUCPassName -SettingName $AUCSetting ` + | Remove-AzureRmVmssAdditionalUnattendContent -ComponentName $AUCComponentName; + +New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS; +This example creates a VMSS configuration object. The first command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command uses the New-AzureRmVmss cmdlet to create a VMSS that uses the VMSS configuration object created in the first command.Set-AzureRmVmssOsProfileSet-AzureRmVmssStorageProfileAdd-AzureRmVmssNetworkInterfaceConfigurationAdd-AzureRmVmssExtensionNew-AzureRmVmssNew-AzureRmVmssIpConfigCreates an IP configuration for a network interface of a VMSS. NewAzureRmVmssIpConfigThe New-AzureRmVmssIpConfig cmdlet creates an IP configuration object for a network interface of a Virtual Machine Scale Set (VMSS). Specify the configuration from this cmdlet as the IPConfiguration parameter of the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet.New-AzureRmVmssIpConfigNameSpecifies the name of the IP configuration.StringIdSpecifies an ID.StringSubnetIdSpecifies the subnet ID in which the configuration creates the VMSS network interface.StringApplicationGatewayBackendAddressPoolsIdSpecifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.System.String[]LoadBalancerBackendAddressPoolsIdSpecifies an array of references to incoming network address translation (NAT) pools of the load balancers. A scale set can reference incoming NAT pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.String[]LoadBalancerInboundNatPoolsIdSpecifies an array of references to incoming NAT pools of the load balancers. A scale set can reference incoming NAT pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.String[]ApplicationGatewayBackendAddressPoolsIdSpecifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.System.String[]System.String[]noneIdSpecifies an ID.StringStringnoneLoadBalancerBackendAddressPoolsIdSpecifies an array of references to incoming network address translation (NAT) pools of the load balancers. A scale set can reference incoming NAT pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.String[]String[]noneLoadBalancerInboundNatPoolsIdSpecifies an array of references to incoming NAT pools of the load balancers. A scale set can reference incoming NAT pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.String[]String[]noneNameSpecifies the name of the IP configuration.StringStringnoneSubnetIdSpecifies the subnet ID in which the configuration creates the VMSS network interface.StringStringnoneExample 1: Create an IP configuration object for a VMSS interfacePS C:\>$IPConfiguration = New-AzureRmVmssIPConfig -Name "ContosoVmssInterface02" -SubnetId $SubnetId +This command creates an IP configuration object named ContosoVmssInterface02. The command uses a previously defined subnet ID stored in $SubnetId. The command stores the configuration settings in the $IPConfiguration variable for later use with Add-AzureRmVmssNetworkInterfaceConfiguration.Example 2: Create an IP configuration object that includes NAT pool settingsPS C:\>$IPConfiguration = New-AzureRmVmssIPConfig -Name "ContosoVmssInterface03" -LoadBalancerInboundNatPoolsId $expectedLb.InboundNatPools[0].Id -LoadBalancerBackendAddressPoolsId $expectedLb.BackendAddressPools[0].Id -SubnetId $SubnetId +This command creates an IP configuration object named ContosoVmssInterface03, and then stores it in the $IPConfiguration variable for later use. The command uses a previously defined subnet ID stored in $SubnetId. The command stores the configuration settings in the $IPConfiguration variable for later use. The command specifies values for the LoadBalancerInboundNatPoolsId and LoadBalancerBackendAddressPoolsId parameters. Add-AzureRmVmssNetworkInterfaceConfigurationNew-AzureRmVmssVaultCertificateConfigCreates a Key Vault certificate configuration.NewAzureRmVmssVaultCertificateConfigThe New-AzureRmVmssVaultCertificateConfig cmdlet specifies the secret that needs to be placed on the Virtual Machine Scale Set (VMSS) virtual machines. The output of this cmdlet is intended to be used with the Add-AzureRmVmssSecret cmdlet.New-AzureRmVmssVaultCertificateConfigCertificateUrlSpecifies the URI of a certificate stored in the Key Vault.It is the base64 encoding of the following JSON Object which is encoded in UTF-8:{ + "data":"<Base64-encoded-certificate>", + "dataType":"pfx", + "password":"<pfx-file-password>" +}StringCertificateStoreSpecifies the certificate store on the virtual machines in the scale set where the certificate is added. This is only valid for Windows Virtual Machine Scale Sets.StringCertificateStoreSpecifies the certificate store on the virtual machines in the scale set where the certificate is added. This is only valid for Windows Virtual Machine Scale Sets.StringStringnoneCertificateUrlSpecifies the URI of a certificate stored in the Key Vault.It is the base64 encoding of the following JSON Object which is encoded in UTF-8:{ + "data":"<Base64-encoded-certificate>", + "dataType":"pfx", + "password":"<pfx-file-password>" +}StringStringnoneThis cmdlet does not generate any output.Example 1: Create a Key Vault certificate configurationPS C:\>New-AzureRmVmssVaultCertificateConfig -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" -CertificateStore "MyCerts" + +This command creates a Key Vault certificate configuration that uses the certificate store named MyCerts located at the specified certificate URL.Add-AzureRmVmssSecretNew-AzureRmVmssCreates a VMSS.NewAzureRmVmssThe New-AzureRmVmss cmdlet creates a Virtual Machine Scale Set (VMSS) in Azure. This cmdlet takes a VirtualMachineScaleSet object as input.New-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringNameSpecifies the name of the VMSS that this cmdlet creates.StringVirtualMachineScaleSetSpecifies the VirtualMachineScaleSet object that contains the properties of the VMSS that this cmdlet creates.VirtualMachineScaleSetConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.NameSpecifies the name of the VMSS that this cmdlet creates.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVirtualMachineScaleSetSpecifies the VirtualMachineScaleSet object that contains the properties of the VMSS that this cmdlet creates.VirtualMachineScaleSetVirtualMachineScaleSetnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseThis cmdlet does not generate any output.Example 1: Create a VMSSPS C:\># Common +$LOC = "WestUs"; +$RGName = "rgkyvms"; + +New-AzureRmResourceGroup -Name $RGName -Location $LOC -Force; + +# SRP +$STOName = "STO" + $RGName; +$STOType = "Standard_GRS"; +New-AzureRmStorageAccount -ResourceGroupName $RGName -Name $STOName -Location $LOC -Type $STOType; +$STOAccount = Get-AzureRmStorageAccount -ResourceGroupName $RGName -Name $STOName; + +# NRP +$SubNet = New-AzureRmVirtualNetworkSubnetConfig -Name ("subnet" + $RGName) -AddressPrefix "10.0.0.0/24"; +$VNet = New-AzureRmVirtualNetwork -Force -Name ("vnet" + $RGName) -ResourceGroupName $RGName -Location $LOC -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $SubNet; +$VNet = Get-AzureRmVirtualNetwork -Name ('vnet' + $RGName) -ResourceGroupName $RGName; +$SubNetId = $VNet.Subnets[0].Id; + +$PubIP = New-AzureRmPublicIpAddress -Force -Name ("PubIP" + $RGName) -ResourceGroupName $RGName -Location $LOC -AllocationMethod Dynamic -DomainNameLabel ("PubIP" + $RGName); +$PubIP = Get-AzureRmPublicIpAddress -Name ("PubIP" + $RGName) -ResourceGroupName $RGName; + +# Create LoadBalancer +$FrontendName = "fe" + $RGName +$BackendAddressPoolName = "bepool" + $RGName +$ProbeName = "vmssprobe" + $RGName +$InboundNatPoolName = "innatpool" + $RGName +$LBRuleName = "lbrule" + $RGName +$LBName = "vmsslb" + $RGName + +$Frontend = New-AzureRmLoadBalancerFrontendIpConfig -Name $FrontendName -PublicIpAddress $PubIP +$BackendAddressPool = New-AzureRmLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName +$Probe = New-AzureRmLoadBalancerProbeConfig -Name $ProbeName -RequestPath healthcheck.aspx -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2 +$InboundNatPool = New-AzureRmLoadBalancerInboundNatPoolConfig -Name $InboundNatPoolName -FrontendIPConfigurationId ` + $Frontend.Id -Protocol Tcp -FrontendPortRangeStart 3360 -FrontendPortRangeEnd 3362 -BackendPort 3370; +$LBRule = New-AzureRmLoadBalancerRuleConfig -Name $LBRuleName ` + -FrontendIPConfiguration $Frontend -BackendAddressPool $BackendAddressPool ` + -Probe $Probe -Protocol Tcp -FrontendPort 80 -BackendPort 80 ` + -IdleTimeoutInMinutes 15 -EnableFloatingIP -LoadDistribution SourceIP; +$ActualLb = New-AzureRmLoadBalancer -Name $LBName -ResourceGroupName $RGName -Location $LOC ` + -FrontendIpConfiguration $Frontend -BackendAddressPool $BackendAddressPool ` + -Probe $Probe -LoadBalancingRule $LBRule -InboundNatPool $InboundNatPool; +$ExpectedLb = Get-AzureRmLoadBalancer -Name $LBName -ResourceGroupName $RGName + +# New VMSS Parameters +$VMSSName = "VMSS" + $RGName; + +$AdminUsername = "Admin01"; +$AdminPassword = "p4ssw0rd@123" + $RGName; + +$PublisherName = "MicrosoftWindowsServer" +$Offer = "WindowsServer" +$Sku = "2012-R2-Datacenter" +$Version = "latest" + +$VHDContainer = "https://" + $STOName + ".blob.core.contoso.net/" + $VMSSName; + +$ExtName = "CSETest"; +$Publisher = "Microsoft.Compute"; +$ExtType = "BGInfo"; +$ExtVer = "2.1"; - $csName = 'cs' + $rgname; - $masterDnsPrefixName = 'master' + $rgname; - $agentPoolDnsPrefixName = 'ap' + $rgname; - $agentPoolProfileName = 'AgentPool1'; - $vmSize = 'Standard_A1'; +#IP Config for the NIC +$IPCfg = New-AzureRmVmssIPConfig -Name "Test" ` + -LoadBalancerInboundNatPoolsId $ExpectedLb.InboundNatPools[0].Id ` + -LoadBalancerBackendAddressPoolsId $ExpectedLb.BackendAddressPools[0].Id ` + -SubnetId $SubNetId; + +#VMSS Config +$VMSS = New-AzureRmVmssConfig -Location $LOC -SkuCapacity 2 -SkuName "Standard_A2" -UpgradePolicyMode "Automatic" ` + | Add-AzureRmVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg ` + | Add-AzureRmVmssNetworkInterfaceConfiguration -Name "Test2" -IPConfiguration $IPCfg ` + | Set-AzureRmVmssOSProfile -ComputerNamePrefix "Test" -AdminUsername $AdminUsername -AdminPassword $AdminPassword ` + | Set-AzureRmVmssStorageProfile -Name "Test" -OsDiskCreateOption 'FromImage' -OsDiskCaching "None" ` + -ImageReferenceOffer $Offer -ImageReferenceSku $Sku -ImageReferenceVersion $Version ` + -ImageReferencePublisher $PublisherName -VhdContainer $VHDContainer ` + | Add-AzureRmVmssExtension -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $True - $orchestratorType = 'DCOS'; - $adminUserName = 'acsLinuxAdmin'; - $sshPublicKey = "<ssh-key>" +#Create the VMSS +New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS; +The following complex example creates a VMSS. The first command creates a resource group with the specified name and location. The second command uses the New-AzureRmStorageAccount cmdlet to create a storage account. The third command then uses the Get-AzureRmStorageAccount cmdlet to get the storage account created in the second command and stores the result in the $STOAccount variable. The fifth command uses the New-AzureRmVirtualNetworkSubnetConfig cmdlet to create a subnet and stores the result in the variable named $SubNet. The sixth command uses the New-AzureRmVirtualNetwork cmdlet to create a virtual network and stores the result in the variable named $VNet. The seventh command uses the Get-AzureRmVirtualNetwork to get information about the virtual network created in the sixth command and stores the information in the variable named $VNet. The eighth and ninth command uses the New-AzureRmPublicIpAddress and Get- AzureRmPublicIpAddress to create and get information from that public IP address. The commands store the information in the variable named $PubIP. The tenth command uses the New- AzureRmLoadBalancerFrontendIpConfig cmdlet to create a frontend load balancer and stores the result in the variable named $Frontend. The eleventh command uses the New-AzureRmLoadBalancerBackendAddressPoolConfig to create a backend address pool configuration and stores the result in the variable named $BackendAddressPool. The twelfth command uses the New-AzureRmLoadBalancerProbeConfig to create a probe and stores the probe information in the variable named $Probe. The thirteenth command uses the New-AzureRmLoadBalancerInboundNatPoolConfig cmdlet to create a load balancer inbound network address translation (NAT) pool configuration. The fourteenth command uses the New-AzureRmLoadBalancerRuleConfig to create a load balancer rule configuration and stores the result in the variable named $LBRule. The fifteenth command uses the New-AzureRmLoadBalancer cmdlet to create a load balancer and stores the result in the variable named $ActualLb. The sixteenth command uses the Get-AzureRmLoadBalancer to get information about the load balancer that was created in the fifteenth command and stores the information in the variable named $ExpectedLb. The seventeenth command uses the New-AzureRmVmssIPConfig cmdlet to create a VMSS IP configuration and stores the information in the variable named $IPCfg. The eighteenth command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The nineteenth command uses the New-AzureRmVmss cmdlet to create the VMSS.Get-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssNew-AzureRmVMCreates a virtual machine.NewAzureRmVMThe New-AzureRmVM cmdlet creates a virtual machine in Azure. This cmdlet takes a virtual machine object as input. Use the New-AzureRmVMConfig cmdlet to create a virtual machine object. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk.New-AzureRmVMResourceGroupNameSpecifies the name of a resource group.StringLocationSpecifies a location for the virtual machine.StringVMSpecifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureRmVMConfig cmdlet. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, and Add-AzureRmVMNetworkInterface. PSVirtualMachineDisableBginfoExtensionIndicates that this cmdlet does not install the BG Info extension on the virtual machine.LicenseTypeSpecifies a license type, which indicates that the image or disk for the virtual machine was licensed on-premises. This value is used only for images that contain the Windows Server operating system. The acceptable values for this parameter are: -$container = New-AzureRmContainerServiceConfig -Location $loc -OrchestratorType $orchestratorType ` - -MasterDnsPrefix $masterDnsPrefixName -AdminUsername $adminUserName -SshPublicKey $sshPublicKey ` -| Add-AzureRmContainerServiceAgentPoolProfile -Name $agentPoolProfileName -VmSize $vmSize -DnsPrefix $agentPoolDnsPrefixName ` +-- Windows_Client +-- Windows_ServerThis value cannot be updated. If you specify this parameter for an update, the value must match the initial value for the virtual machine. System.StringTagsSpecifies that resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.HashtableConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.DisableBginfoExtensionIndicates that this cmdlet does not install the BG Info extension on the virtual machine.SwitchParameterSwitchParameternoneLicenseTypeSpecifies a license type, which indicates that the image or disk for the virtual machine was licensed on-premises. This value is used only for images that contain the Windows Server operating system. The acceptable values for this parameter are: -New-AzureRmContainerService -ResourceGroupName $rgname -Name $csName -ContainerService $container; - - - - - - - - - - - - - - - - - - - - - - New-AzureRmContainerServiceConfig - - Create the container service local config object - - - - - New - AzureRmContainerServiceConfig - - - - This cmdlet creates the container service local config object. This object is intended to be passed on to the New-AzureRmContainerService cmdlet for creating the Container Service. - - - - New-AzureRmContainerServiceConfig - - Location - - Location to create the Container Service in. - - String - - - Tag - - Tags for the Container Service - - Hashtable - - - OrchestratorType - - Type of Container Service orchestrator. Valid values are "DCOS" and "Swarm" - - Nullable`1[ContainerServiceOchestratorTypes] - - - MasterCount - - Number of master virtual machines to create - - Nullable`1[Int32] - - - MasterDnsPrefix - - DNS prefix for the master virtual machine - - String - - - AgentPoolProfile - - Agent pool profile object that is added with the Add-AzureRmContainerServiceAgentPoolProfile cmdlet. - - ContainerServiceAgentPoolProfile[] - - - WindowsProfileAdminUsername - - Admin Username for the Windows based container service - - String - - - WindowsProfileAdminPassword - - Admin Password for the Windows based container service - - String - - - AdminUsername - - Admin Username for the Linux based container service - - String - - - SshPublicKey - - SSH public key for the Linux based container service - - String[] - - - VmDiagnosticsEnabled - - Enable diagnostics for the container service virtual machine - - Nullable`1[Boolean] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location to create the Container Service in. - - String - - String - - - - - - Tag - - Tags for the Container Service - - Hashtable - - Hashtable - - - - - - OrchestratorType - - Type of Container Service orchestrator. Valid values are "DCOS" and "Swarm" - - Nullable`1[ContainerServiceOchestratorTypes] - - Nullable`1[ContainerServiceOchestratorTypes] - - - - - - MasterCount - - Number of master virtual machines to create - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - MasterDnsPrefix - - DNS prefix for the master virtual machine - - String - - String - - - - - - AgentPoolProfile - - Agent pool profile object that is added with the Add-AzureRmContainerServiceAgentPoolProfile cmdlet. - - ContainerServiceAgentPoolProfile[] - - ContainerServiceAgentPoolProfile[] - - - - - - WindowsProfileAdminUsername - - Admin Username for the Windows based container service - - String - - String - - - - - - WindowsProfileAdminPassword - - Admin Password for the Windows based container service - - String - - String - - - - - - AdminUsername - - Admin Username for the Linux based container service - - String - - String - - - - - - SshPublicKey - - SSH public key for the Linux based container service - - String[] - - String[] - - - - - - VmDiagnosticsEnabled - - Enable diagnostics for the container service virtual machine - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $container = New-AzureRmContainerServiceConfig -Location $loc -OrchestratorType $orchestratorType ` - -MasterDnsPrefix $masterDnsPrefixName -AdminUsername $adminUserName -SshPublicKey $sshPublicKey ` - | Add-AzureRmContainerServiceAgentPoolProfile -Name $agentPoolProfileName -VmSize $vmSize -DnsPrefix $agentPoolDnsPrefixName - - - - - - - - - - - - - - - - - - - - - - New-AzureRmVM - - Creates a virtual machine. - - - - - New - AzureRmVM - - - - The New-AzureRmVM cmdlet creates a virtual machine in Azure. This cmdlet takes a virtual machine object as input. Use the New-AzureRmVMConfig cmdlet to create a virtual machine object. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk. - - - - New-AzureRmVM - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Location - - Specifies a location for the virtual machine. - - String - - - VM - - Specifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureRmVMConfig cmdlet. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, and Add-AzureRmVMNetworkInterface. - - PSVirtualMachine - - - DisableBginfoExtension - - Disable the BG Info extension from being installed on the Virtual Machine - - SwitchParameter - - - Tags - - Specifies that resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags. - - Hashtable - - - LicenseType - - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. - Possible values are: - - Windows_Client - - Windows_Server - If this element is included in a request for an update, the value must match the intitial value. This value cannot be updated. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Location - - Specifies a location for the virtual machine. - - String - - String - - - none - - - VM - - Specifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureRmVMConfig cmdlet. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, and Add-AzureRmVMNetworkInterface. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - DisableBginfoExtension - - Disable the BG Info extension from being installed on the Virtual Machine - - SwitchParameter - - SwitchParameter - - - none - - - Tags - - Specifies that resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags. - - Hashtable - - Hashtable - - - none - - - LicenseType - - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. - Possible values are: - - Windows_Client - - Windows_Server - If this element is included in a request for an update, the value must match the intitial value. This value cannot be updated. - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a virtual machine -------------------------- - - PS C:\> - - PS C:\># Variables +-- Windows_Client +-- Windows_ServerThis value cannot be updated. If you specify this parameter for an update, the value must match the initial value for the virtual machine. System.StringSystem.StringnoneLocationSpecifies a location for the virtual machine.StringStringnoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneTagsSpecifies that resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.HashtableHashtablenoneVMSpecifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureRmVMConfig cmdlet. Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, and Add-AzureRmVMNetworkInterface. PSVirtualMachinePSVirtualMachinenoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Create a virtual machine PS C:\># Variables ## Global -$ResourceGroupName = "ResourceGroup11" -$Location = "WestEurope" +$ResourceGroupName = "ResourceGroup11" +$Location = "WestEurope" ## Storage -$StorageName = "GeneralStorage6cc" -$StorageType = "Standard_GRS" +$StorageName = "GeneralStorage6cc" +$StorageType = "Standard_GRS" ## Network -$InterfaceName = "ServerInterface06" -$Subnet1Name = "Subnet1" -$VNetName = "VNet09" -$VNetAddressPrefix = "10.0.0.0/16" -$VNetSubnetAddressPrefix = "10.0.0.0/24" +$InterfaceName = "ServerInterface06" +$Subnet1Name = "Subnet1" +$VNetName = "VNet09" +$VNetAddressPrefix = "10.0.0.0/16" +$VNetSubnetAddressPrefix = "10.0.0.0/24" ## Compute -$VMName = "VirtualMachine12" -$ComputerName = "Server22" -$VMSize = "Standard_A2" -$OSDiskName = $VMName + "OSDisk" +$VMName = "VirtualMachine12" +$ComputerName = "Server22" +$VMSize = "Standard_A2" +$OSDiskName = $VMName + "OSDisk" # Resource Group New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location @@ -9979,63 +340,44 @@ $Interface = New-AzureRmNetworkInterface -Name $InterfaceName -ResourceGroupName $Credential = Get-Credential $VirtualMachine = New-AzureRmVMConfig -VMName $VMName -VMSize $VMSize $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate -$VirtualMachine = Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest" +$VirtualMachine = Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest" $VirtualMachine = Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id $Interface.Id -$OSDiskUri = $StorageAccount.PrimaryEndpoints.Blob.ToString() + "vhds/" + $OSDiskName + ".vhd" +$OSDiskUri = $StorageAccount.PrimaryEndpoints.Blob.ToString() + "vhds/" + $OSDiskName + ".vhd" $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name $OSDiskName -VhdUri $OSDiskUri -CreateOption FromImage ## Create the VM in Azure -New-AzureRmVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $VirtualMachine - - This example script shows how to create a virtual machine. This script uses several other cmdlets. - - - - - - - - - - - - - - -------------------------- Example 2: Create a virtual machine from a custom user image -------------------------- - - PS C:\> - - PS C:\>## VM Account +New-AzureRmVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $VirtualMachine +This example script shows how to create a virtual machine. This script uses several other cmdlets. Example 2: Create a virtual machine from a custom user imagePS C:\>## VM Account # Credentials for Local Admin account you created in the sysprepped (generalized) vhd image -$VMLocalAdminUser = "LocalAdminUser" -$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force +$VMLocalAdminUser = "LocalAdminUser" +$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force ## Azure Account -$LocationName = "westus" -$ResourceGroupName = "MyResourceGroup" +$LocationName = "westus" +$ResourceGroupName = "MyResourceGroup" # This a Premium_LRS storage account. # It is required in order to run a client VM with efficiency and high performance. -$StorageAccount = "Mydisk" +$StorageAccount = "Mydisk" ## VM -$OSDiskName = "MyClient" -$ComputerName = "MyClientVM" -$OSDiskUri = "https://Mydisk.blob.core.windows.net/disks/MyOSDisk.vhd" -$SourceImageUri = "https://Mydisk.blob.core.windows.net/vhds/MyOSImage.vhd" -$VMName = "MyVM" +$OSDiskName = "MyClient" +$ComputerName = "MyClientVM" +$OSDiskUri = "https://Mydisk.blob.core.windows.net/disks/MyOSDisk.vhd" +$SourceImageUri = "https://Mydisk.blob.core.windows.net/vhds/MyOSImage.vhd" +$VMName = "MyVM" # Modern hardware environment with fast disk, high IOPs performance. # Required to run a client VM with efficiency and performance -$VMSize = "Standard_DS3" -$OSDiskCaching = "ReadWrite" -$OSCreateOption = "FromImage" +$VMSize = "Standard_DS3" +$OSDiskCaching = "ReadWrite" +$OSCreateOption = "FromImage" ## Networking -$DNSNameLabel = "mydnsname" # mydnsname.westus.cloudapp.azure.com -$NetworkName = "MyNet" -$NICName = "MyNIC" -$PublicIPAddressName = "MyPIP" -$SubnetName = "MySubnet" -$SubnetAddressPrefix = "10.0.0.0/24" -$VnetAddressPrefix = "10.0.0.0/16" +$DNSNameLabel = "mydnsname" # mydnsname.westus.cloudapp.azure.com +$NetworkName = "MyNet" +$NICName = "MyNIC" +$PublicIPAddressName = "MyPIP" +$SubnetName = "MySubnet" +$SubnetAddressPrefix = "10.0.0.0/24" +$VnetAddressPrefix = "10.0.0.0/16" $SingleSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix $Vnet = New-AzureRmVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroupName -Location $LocationName -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet @@ -10049,12094 +391,150 @@ $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -Com $VirtualMachine = Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name $OSDiskName -VhdUri $OSDiskUri -SourceImageUri $SourceImageUri -Caching $OSDiskCaching -CreateOption $OSCreateOption -Windows -New-AzureRmVM -ResourceGroupName $ResourceGroupName -Location $LocationName -VM $VirtualMachine -Verbose - - This example takes an existing sys-prepped, generalized custom operating system image and attaches a data disk to it, provisions a new network, deploys the VHD, and runs it. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - Remove-AzureRmVM - - - - Restart-AzureRmVM - - - - Start-AzureRmVM - - - - Stop-AzureRmVM - - - - Update-AzureRmVM - - - - Add-AzureRmVMDataDisk - - - - Add-AzureRmVMNetworkInterface - - - - New-AzureRmVMConfig - - - - Set-AzureRmVMOperatingSystem - - - - Set-AzureRmVMSourceImage - - - - Set-AzureRmVMOSDisk - - - - - - - - New-AzureRmVMConfig - - Creates a configurable virtual machine object. - - - - - New - AzureRmVMConfig - - - - The New-AzureRmVMConfig cmdlet creates a configurable local virtual machine object for Azure. Other cmdlets can be used to configure a virtual machine object, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk. - - - - New-AzureRmVMConfig - - VMName - - Specifies a name for the virtual machine. - - String - - - VMSize - - Specifies the size for the virtual machine. - - String - - - AvailabilitySetId - - Specifies the ID of an availability set. To obtain an availability set object, use the Get-AzureRmAvailabilitySet cmdlet. The availability set object contains an ID property. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VMName - - Specifies a name for the virtual machine. - - String - - String - - - none - - - VMSize - - Specifies the size for the virtual machine. - - String - - String - - - none - - - AvailabilitySetId - - Specifies the ID of an availability set. To obtain an availability set object, use the Get-AzureRmAvailabilitySet cmdlet. The availability set object contains an ID property. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a virtual machine object -------------------------- - - PS C:\> - - PS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id - - The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. - - - - - - - - - - - - - - - - Update-AzureRmVM - - - - Set-AzureRmVMOperatingSystem - - - - Set-AzureRmVMSourceImage - - - - Get-AzureRmAvailabilitySet - - - - - - - - New-AzureRmVmss - - Creates a VMSS. - - - - - New - AzureRmVmss - - - - The New-AzureRmVmss cmdlet creates a Virtual Machine Scale Set (VMSS) in Azure. This cmdlet takes a VirtualMachineScaleSet object as input. - - - - New-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - Name - - Specifies the name of the VMSS that this cmdlet creates. - - String - - - VirtualMachineScaleSet - - Specifies the VirtualMachineScaleSet object that contains the properties of the VMSS that this cmdlet creates. - - VirtualMachineScaleSet - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - Name - - Specifies the name of the VMSS that this cmdlet creates. - - String - - String - - - none - - - VirtualMachineScaleSet - - Specifies the VirtualMachineScaleSet object that contains the properties of the VMSS that this cmdlet creates. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a VMSS -------------------------- - - PS C:\> - - PS C:\># Common -$LOC = 'westus'; -$RGName = 'rgkyvms'; - -New-AzureRmResourceGroup -Name $RGName -Location $LOC -Force; - -# SRP -$STOName = 'sto' + $RGName; -$STOType = 'Standard_GRS'; -New-AzureRmStorageAccount -ResourceGroupName $RGName -Name $STOName -Location $LOC -Type $STOType; -$stoaccount = Get-AzureRmStorageAccount -ResourceGroupName $RGName -Name $STOName; - -# NRP -$SubNet = New-AzureRmVirtualNetworkSubnetConfig -Name ('subnet' + $RGName) -AddressPrefix "10.0.0.0/24"; -$VNet = New-AzureRmVirtualNetwork -Force -Name ('vnet' + $RGName) -ResourceGroupName $RGName -Location $LOC -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $SubNet; -$VNet = Get-AzureRmVirtualNetwork -Name ('vnet' + $RGName) -ResourceGroupName $RGName; -$SubNetId = $VNet.Subnets[0].Id; - -$PubIP = New-AzureRmPublicIpAddress -Force -Name ('pubip' + $RGName) -ResourceGroupName $RGName -Location $LOC -AllocationMethod Dynamic -DomainNameLabel ('pubip' + $RGName); -$PubIP = Get-AzureRmPublicIpAddress -Name ('pubip' + $RGName) -ResourceGroupName $RGName; - -# Create LoadBalancer -$FrontendName = 'fe' + $RGName -$BackendAddressPoolName = 'bepool' + $RGName -$ProbeName = 'vmssprobe' + $RGName -$InboundNatPoolName = 'innatpool' + $RGName -$LBRuleName = 'lbrule' + $RGName -$LBName = 'vmsslb' + $RGName - -$Frontend = New-AzureRmLoadBalancerFrontendIpConfig -Name $FrontendName -PublicIpAddress $PubIP -$BackendAddressPool = New-AzureRmLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName -$Probe = New-AzureRmLoadBalancerProbeConfig -Name $ProbeName -RequestPath healthcheck.aspx -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2 -$InboundNatPool = New-AzureRmLoadBalancerInboundNatPoolConfig -Name $InboundNatPoolName -FrontendIPConfigurationId ` - $Frontend.Id -Protocol Tcp -FrontendPortRangeStart 3360 -FrontendPortRangeEnd 3362 -BackendPort 3370; -$LBRule = New-AzureRmLoadBalancerRuleConfig -Name $LBRuleName ` - -FrontendIPConfiguration $Frontend -BackendAddressPool $BackendAddressPool ` - -Probe $Probe -Protocol Tcp -FrontendPort 80 -BackendPort 80 ` - -IdleTimeoutInMinutes 15 -EnableFloatingIP -LoadDistribution SourceIP; -$ActualLb = New-AzureRmLoadBalancer -Name $LBName -ResourceGroupName $RGName -Location $LOC ` - -FrontendIpConfiguration $Frontend -BackendAddressPool $BackendAddressPool ` - -Probe $Probe -LoadBalancingRule $LBRule -InboundNatPool $InboundNatPool; -$expectedLb = Get-AzureRmLoadBalancer -Name $LBName -ResourceGroupName $RGName - -# New VMSS Parameters -$VMSSName = 'vmss' + $RGName; - -$AdminUsername = 'Foo12'; -$AdminPassword = "BaR@123" + $RGName; - -$PublisherName = 'MicrosoftWindowsServer' -$Offer = 'WindowsServer' -$Sku = '2012-R2-Datacenter' -$Version = 'latest' - -$vhdContainer = "https://" + $STOName + ".blob.core.contoso.net/" + $VMSSName; - -$ExtName = 'csetest'; -$Publisher = 'Microsoft.Compute'; -$ExtType = 'BGInfo'; -$ExtVer = '2.1'; - -#IP Config for the NIC -$IPCfg = New-AzureRmVmssIPConfig -Name 'test' ` - -LoadBalancerInboundNatPoolsId $expectedLb.InboundNatPools[0].Id ` - -LoadBalancerBackendAddressPoolsId $expectedLb.BackendAddressPools[0].Id ` - -SubnetId $SubNetId; - -#VMSS config -$VMSS = New-AzureRmVmssConfig -Location $LOC -SkuCapacity 2 -SkuName 'Standard_A2' -UpgradePolicyMode 'automatic' ` - | Add-AzureRmVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $IPCfg ` - | Add-AzureRmVmssNetworkInterfaceConfiguration -Name 'test2' -IPConfiguration $IPCfg ` - | Set-AzureRmVmssOSProfile -ComputerNamePrefix 'test' -AdminUsername $AdminUsername -AdminPassword $AdminPassword ` - | Set-AzureRmVmssStorageProfile -Name 'test' -OsDiskCreateOption 'FromImage' -OsDiskCaching 'None' ` - -ImageReferenceOffer $Offer -ImageReferenceSku $Sku -ImageReferenceVersion $Version ` - -ImageReferencePublisher $PublisherName -VhdContainer $vhdContainer ` - | Add-AzureRmVmssExtension -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $true - -#Create the VMSS -New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS; - - The following example creates a VMSS. - - - - - - - - - - - - - - - - - - - - New-AzureRmVmssConfig - - Creates a VMSS configuration object. - - - - - New - AzureRmVmssConfig - - - - The New-AzureRmVmssConfig cmdlet creates a configurable local Virtual Manager Scale Set (VMSS) object. Other cmdlets are needed to configure the VMSS object. These are cmdlets are: - -- Set-AzureRmVmssOsProfile --- Set-AzureRmVmssStorageProfile --- Add-AzureRmVmssNetworkInterfaceConfiguration --- Add-AzureRmVmssExtension - - - - New-AzureRmVmssConfig - - OverProvision - - Indicates whether the cmdlet overprovisions the VMSS. - - Nullable`1[Boolean] - - - Location - - Specifies the Azure location where the VMSS is created. - - String - - - Tag - - Specifies the tags that will be assigned to the VMSS. - - Hashtable - - - SkuName - - Specifies the size of all the instances of VMSS. - - String - - - SkuTier - - Specifies the tier of VMSS. - The acceptable values for this parameter are: - -- Standard --- Basic - - String - - - SkuCapacity - - Specifies the number of instances in the VMSS. - - Nullable`1[Int64] - - - UpgradePolicyMode - - Specified the mode of an upgrade to virtual machines in the scale set. - The acceptable values for this parameter are: - -- Automatic --- Manual - - Nullable`1[UpgradeMode] - - - OsProfile - - Specifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzureRmVmssOsProfile cmdlet to set this object. - - VirtualMachineScaleSetOSProfile - - - StorageProfile - - Specifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzureRmVmssStorageProfile cmdlet to set this object. - - VirtualMachineScaleSetStorageProfile - - - NetworkInterfaceConfiguration - - Specifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet to add this object. - - VirtualMachineScaleSetNetworkConfiguration[] - - - Extension - - Specifies the extension information object for the VMSS. You can use the Add-AzureRmVmssExtension cmdlet to add this object. - - VirtualMachineScaleSetExtension[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - OverProvision - - Indicates whether the cmdlet overprovisions the VMSS. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - Location - - Specifies the Azure location where the VMSS is created. - - String - - String - - - none - - - Tag - - Specifies the tags that will be assigned to the VMSS. - - Hashtable - - Hashtable - - - none - - - SkuName - - Specifies the size of all the instances of VMSS. - - String - - String - - - none - - - SkuTier - - Specifies the tier of VMSS. - The acceptable values for this parameter are: - -- Standard --- Basic - - String - - String - - - none - - - SkuCapacity - - Specifies the number of instances in the VMSS. - - Nullable`1[Int64] - - Nullable`1[Int64] - - - none - - - UpgradePolicyMode - - Specified the mode of an upgrade to virtual machines in the scale set. - The acceptable values for this parameter are: - -- Automatic --- Manual - - Nullable`1[UpgradeMode] - - Nullable`1[UpgradeMode] - - - none - - - OsProfile - - Specifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzureRmVmssOsProfile cmdlet to set this object. - - VirtualMachineScaleSetOSProfile - - VirtualMachineScaleSetOSProfile - - - none - - - StorageProfile - - Specifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzureRmVmssStorageProfile cmdlet to set this object. - - VirtualMachineScaleSetStorageProfile - - VirtualMachineScaleSetStorageProfile - - - none - - - NetworkInterfaceConfiguration - - Specifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet to add this object. - - VirtualMachineScaleSetNetworkConfiguration[] - - VirtualMachineScaleSetNetworkConfiguration[] - - - none - - - Extension - - Specifies the extension information object for the VMSS. You can use the Add-AzureRmVmssExtension cmdlet to add this object. - - VirtualMachineScaleSetExtension[] - - VirtualMachineScaleSetExtension[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ProvisioningState - - - - string - - string - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a VMSS configuration object -------------------------- - - PS C:\> - - PS C:\>$VMSS = New-AzureRmVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic" -NetworkInterfaceConfiguration $NetCfg ` - | Add-AzureRmVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg ` - | Set-AzureRmVmssOSProfile -ComputerNamePrefix "Test" -AdminUsername $adminUsername -AdminPassword $AdminPassword ` - | Set-AzureRmVmssStorageProfile -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" ` - -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version ` - -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VHDContainer ` - | Add-AzureRmVmssAdditionalUnattendContent -ComponentName $AUCComponentName -Content $AUCContent -PassName $AUCPassName -SettingName $AUCSetting ` - | Remove-AzureRmVmssAdditionalUnattendContent -ComponentName $AUCComponentName; - -New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS; - - This example creates a VMSS configuration object. - - - - - - - - - - - - - - - - Set-AzureRmVmssOsProfile - - - - Set-AzureRmVmssStorageProfile - - - - Add-AzureRmVmssNetworkInterfaceConfiguration - - - - Add-AzureRmVmssExtension - - - - - - - - New-AzureRmVmssIpConfig - - Create a IP configuration for the VM Scale Set network interface - - - - - New - AzureRmVmssIpConfig - - - - This cmdlet creates an IP configuration for the VM Scale Set network interface. The output object of this cmdlet is used in the IPConfiguration parameter of the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet. - - - - New-AzureRmVmssIpConfig - - Name - - Name of the IP configuration - - String - - - Id - - - - String - - - SubnetId - - Subnet Id to create the VM Scale Set network interface in. - - String - - - ApplicationGatewayBackendAddressPoolsId - - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. - - String[] - - - LoadBalancerBackendAddressPoolsId - - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. - - String[] - - - LoadBalancerInboundNatPoolsId - - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Name - - Name of the IP configuration - - String - - String - - - none - - - Id - - - - String - - String - - - none - - - SubnetId - - Subnet Id to create the VM Scale Set network interface in. - - String - - String - - - none - - - ApplicationGatewayBackendAddressPoolsId - - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. - - String[] - - String[] - - - - - - LoadBalancerBackendAddressPoolsId - - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. - - String[] - - String[] - - - none - - - LoadBalancerInboundNatPoolsId - - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer - - String[] - - String[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $ipCfg = New-AzureRmVmssIPConfig -Name 'test' -SubnetId $subnetId; - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - $ipCfg = New-AzureRmVmssIPConfig -Name 'test' ` - -LoadBalancerInboundNatPoolsId $expectedLb.InboundNatPools[0].Id ` - -LoadBalancerBackendAddressPoolsId $expectedLb.BackendAddressPools[0].Id ` - -SubnetId $subnetId; - - - - - - - - - - - - - - - - - - - - - - New-AzureRmVmssVaultCertificateConfig - - Creates a Key Vault certificate configuration. - - - - - New - AzureRmVmssVaultCertificateConfig - - - - This cmdlet specifies the secret that needs to be placed on the Virtual Machine Scale Set (VMSS) virtual machines. The output of this cmdlet is intended to be used with the Add-AzureRmVmssSecret cmdlet. - - - - New-AzureRmVmssVaultCertificateConfig - - CertificateUrl - - Specifies the URI of a certificate stored in the Key Vault. - It is the base64 encoding of the following JSON Object which is encoded in UTF-8: - { - "data":"<Base64-encoded-certificate>", - "dataType":"pfx", - "password":"<pfx-file-password>" -} - - String - - - CertificateStore - - Specifies the certificate store on the virtual machines in the scale set where the certificate is added. This is only valid for Windows Virtual Machine Scale Sets. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - CertificateUrl - - Specifies the URI of a certificate stored in the Key Vault. - It is the base64 encoding of the following JSON Object which is encoded in UTF-8: - { - "data":"<Base64-encoded-certificate>", - "dataType":"pfx", - "password":"<pfx-file-password>" -} - - String - - String - - - none - - - CertificateStore - - Specifies the certificate store on the virtual machines in the scale set where the certificate is added. This is only valid for Windows Virtual Machine Scale Sets. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Create a Key Vault certificate configuration -------------------------- - - PS C:\> - - PS C:\>New-AzureRmVmssVaultCertificateConfig -CertificateUrl "http://keyVaultName.vault.contoso.net/secrets/secretName/secretVersion" -CertificateStore "MyCerts" - - This command creates a Key Vault certificate configuration that uses the certificate store named MyCerts located at the specified certificate URL. - - - - - - - - - - - - - - - - Add-AzureRmVmssSecret - - - - - - - - New-AzureVMSqlServerAutoBackupConfig - - - - - - - New - AzureVMSqlServerAutoBackupConfig - - - - - - - - New-AzureVMSqlServerAutoBackupConfig - - ResourceGroupName - - - - String - - - Enable - - - - SwitchParameter - - - RetentionPeriodInDays - - - - Int32 - - - EnableEncryption - - - - SwitchParameter - - - CertificatePassword - - - - SecureString - - - StorageUri - - - - Uri - - - StorageKey - - - - SecureString - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - New-AzureVMSqlServerAutoBackupConfig - - ResourceGroupName - - - - String - - - Enable - - - - SwitchParameter - - - RetentionPeriodInDays - - - - Int32 - - - EnableEncryption - - - - SwitchParameter - - - CertificatePassword - - - - SecureString - - - StorageContext - - - - AzureStorageContext - - - StorageUri - - - - Uri - - - StorageKey - - - - SecureString - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - Enable - - - - SwitchParameter - - SwitchParameter - - - none - - - RetentionPeriodInDays - - - - Int32 - - Int32 - - - none - - - EnableEncryption - - - - SwitchParameter - - SwitchParameter - - - none - - - CertificatePassword - - - - SecureString - - SecureString - - - none - - - StorageUri - - - - Uri - - Uri - - - none - - - StorageKey - - - - SecureString - - SecureString - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - StorageContext - - - - AzureStorageContext - - AzureStorageContext - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - New-AzureVMSqlServerAutoPatchingConfig - - - - - - - New - AzureVMSqlServerAutoPatchingConfig - - - - - - - - New-AzureVMSqlServerAutoPatchingConfig - - Enable - - - - SwitchParameter - - - DayOfWeek - - - - String - - - MaintenanceWindowStartingHour - - - - Int32 - - - MaintenanceWindowDuration - - - - Int32 - - - PatchCategory - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Enable - - - - SwitchParameter - - SwitchParameter - - - none - - - DayOfWeek - - - - String - - String - - - none - - - MaintenanceWindowStartingHour - - - - Int32 - - Int32 - - - none - - - MaintenanceWindowDuration - - - - Int32 - - Int32 - - - none - - - PatchCategory - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - New-AzureVMSqlServerKeyVaultCredentialConfig - - - - - - - New - AzureVMSqlServerKeyVaultCredentialConfig - - - - - - - - New-AzureVMSqlServerKeyVaultCredentialConfig - - ResourceGroupName - - - - String - - - Enable - - - - SwitchParameter - - - CredentialName - - - - String - - - AzureKeyVaultUrl - - - - String - - - ServicePrincipalName - - - - String - - - ServicePrincipalSecret - - - - SecureString - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - - - String - - String - - - none - - - Enable - - - - SwitchParameter - - SwitchParameter - - - none - - - CredentialName - - - - String - - String - - - none - - - AzureKeyVaultUrl - - - - String - - String - - - none - - - ServicePrincipalName - - - - String - - String - - - none - - - ServicePrincipalSecret - - - - SecureString - - SecureString - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create Key Vault Credential settings to enable AKV -------------------------- - - PS C:\> - - PS C:\>New-AzureVMSqlServerKeyVaultCredentialConfig -ResourceGroupName "Rg1" -Enable -CredentialName "mycred1" -AzureKeyVaultUrl "https://contosokeyvault.vault.azure.net/" -ServicePrincipalName "fde2b411-33d5-4e11-af04eb07b669ccf2" -ServicePrincipalSecret "9VTJSQwzlFepD8XODnzy8n2V01Jd8dAjwm/azF1XDKM=" - - The New-AzureVMSqlServerKeyVaultCredentialConfig cmdlet creates a configuration object for the Azure Key Vault Integration feature. - - - - - - - - - - - - - - - - - - - - Publish-AzureRmVMDscConfiguration - - Uploads a DSC script to Azure blob storage. - - - - - Publish - AzureRmVMDscConfiguration - - - - The Publish-AzureRmVMDscConfiguration cmdlet uploads a Desired State Configuration (DSC) script to Azure blob storage, which later can be applied to Azure virtual machines using the Set-AzureRmVMDscExtension cmdlet. - - - - Publish-AzureRmVMDscConfiguration - - ResourceGroupName - - Specifies the name of the resource group that contains the storage account. - - String - - - ConfigurationPath - - Specifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file. - - String - - - ContainerName - - Specifies the name of the Azure storage container the configuration is uploaded to. - - String - - - StorageAccountName - - Specifies the Azure storage account name that is used to upload the configuration script to the container specified by the ContainerName parameter. - - String - - - StorageEndpointSuffix - - Specifies the suffix for the storage end point. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - SkipDependencyDetection - - Indicates that this cmdlet excludes DSC resource dependencies from the configuration archive. - - SwitchParameter - - - ConfigurationDataPath - - Specifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdlet - - String - - - AdditionalPath - - Specifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration. - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - Publish-AzureRmVMDscConfiguration - - ConfigurationPath - - Specifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file. - - String - - - OutputArchivePath - - Specifies the path of a local .zip file to write the configuration archive to. When this parameter is used, the configuration script is not uploaded to Azure blob storage. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - SkipDependencyDetection - - Indicates that this cmdlet excludes DSC resource dependencies from the configuration archive. - - SwitchParameter - - - ConfigurationDataPath - - Specifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdlet - - String - - - AdditionalPath - - Specifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration. - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group that contains the storage account. - - String - - String - - - none - - - ConfigurationPath - - Specifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file. - - String - - String - - - none - - - ContainerName - - Specifies the name of the Azure storage container the configuration is uploaded to. - - String - - String - - - none - - - StorageAccountName - - Specifies the Azure storage account name that is used to upload the configuration script to the container specified by the ContainerName parameter. - - String - - String - - - none - - - StorageEndpointSuffix - - Specifies the suffix for the storage end point. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - SkipDependencyDetection - - Indicates that this cmdlet excludes DSC resource dependencies from the configuration archive. - - SwitchParameter - - SwitchParameter - - - none - - - ConfigurationDataPath - - Specifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdlet - - String - - String - - - none - - - AdditionalPath - - Specifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration. - - String[] - - String[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - false - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - false - - - OutputArchivePath - - Specifies the path of a local .zip file to write the configuration archive to. When this parameter is used, the configuration script is not uploaded to Azure blob storage. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a .zip package an upload it to Azure storage -------------------------- - - PS C:\> - - PS C:\>Publish-AzureRmVMDscConfiguration ".\MyConfiguration.ps1" - - This command creates a .zip package for the given script and any dependent resource modules and uploads it to Azure storage. - - - - - - - - - - - - - - -------------------------- Example 2: Create a .zip package and store it to a local file -------------------------- - - PS C:\> - - PS C:\>Publish-AzureRmVMDscConfiguration ".\MyConfiguration.ps1" -OutputArchivePath ".\MyConfiguration.ps1.zip" - - This command creates a .zip package for the given script and any dependent resource modules and stores it in the local file that is named .\MyConfiguration.ps1.zip. - - - - - - - - - - - - - - -------------------------- Example 3: Add configuration to the archive and then upload it to storage -------------------------- - - PS C:\> - - PS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -SkipDependencyDetection - - This command adds configuration named Sample.ps1 to the configuration archive to upload to Azure storage and skips dependent resource modules. - - - - - - - - - - - - - - -------------------------- Example 4: Add configuration and configuration data to the archive and then upload it to storage -------------------------- - - PS C:\> - - PS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -ConfigurationDataPath "C:\SampleData.psd1" - - This command adds configuration named Sample.ps1 and configuration data named SampleData.psd1 to the configuration archive to upload to Azure storage. - - - - - - - - - - - - - - -------------------------- Example 5: Add configuration, configuration data, and additional content to the archive and then upload it to storage -------------------------- - - PS C:\> - - PS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -AdditionalPath @("C:\ContentDir1", "C:\File.txt") -ConfigurationDataPath "C:\SampleData.psd1" - - This command adds configuration named Sample.ps1, configuration data SampleData.psd1, and additional content to configuration archive to upload to Azure storage. - - - - - - - - - - - - - - - - Get-AzureRmVMDscExtension - - - - Remove-AzureRmVMDscExtension - - - - Set-AzureRmVMDscExtension - - - - - - - - Remove-AzureRmAvailabilitySet - - Removes an availability set from Azure. - - - - - Remove - AzureRmAvailabilitySet - - - - The Remove-AzureRmAvailabilitySet cmdlet removes an availability set from Azure. - - - - Remove-AzureRmAvailabilitySet - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - Name - - Specifies the name of the availability set to remove. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - Name - - Specifies the name of the availability set to remove. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove an availability set -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmAvailabilitySet -Name "AvailabilitySet03" -ResourceGroupName "ResourceGroup11" - - This command removes an availability set named AvailablitySet03 in the resource group named ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmAvailabilitySet - - - - New-AzureRmAvailabilitySet - - - - - - - - Remove-AzureRmContainerService - - Remove the Container Service - - - - - Remove - AzureRmContainerService - - - - This cmdlet removes the Container Service from Azure - - - - Remove-AzureRmContainerService - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Resource Group of the Container Service - - String - - - Name - - Name of the Container Service to remove - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group of the Container Service - - String - - String - - - - - - Name - - Name of the Container Service to remove - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Remove-AzureRmContainerService -ResourceGroupName $rgname -Name $csName; - - - - - - - - - - - - - - - - - - - - - - Remove-AzureRmContainerServiceAgentPoolProfile - - Remove an agent pool profile from the Container Service - - - - - Remove - AzureRmContainerServiceAgentPoolProfile - - - - Remove an agent pool profile from the Container Service - - - - Remove-AzureRmContainerServiceAgentPoolProfile - - ContainerService - - Container Service object to remove the agent profile from - - ContainerService - - - Name - - Name of the agent pool profile to be removed - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ContainerService - - Container Service object to remove the agent profile from - - ContainerService - - ContainerService - - - - - - Name - - Name of the agent pool profile to be removed - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Remove-AzureRmVM - - Removes a virtual machine from Azure. - - - - - Remove - AzureRmVM - - - - The Remove-AzureRmVM cmdlet removes a virtual machine from Azure. - - - - Remove-AzureRmVM - - Name - - Specifies the name of the virtual machine to remove. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - Remove-AzureRmVM - - Name - - Specifies the name of the virtual machine to remove. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - Name - - Specifies the name of the virtual machine to remove. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - ResourceGroupName - - Specifies the name of a resource group. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove a virtual machine -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" - - This command removes the virtual machine named VirtualMachine07 in the resource group ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVM - - - - Restart-AzureRmVM - - - - Start-AzureRmVM - - - - Stop-AzureRmVM - - - - Update-AzureRmVM - - - - - - - - Remove-AzureRmVMAccessExtension - - Removes the VMAccess extension from a virtual machine. - - - - - Remove - AzureRmVMAccessExtension - - - - The Remove-AzureRmVMAccessExtension cmdlet removes the Virtual Machine Access (VMAccess) Virtual Machine Extension from a virtual machine. - - - - Remove-AzureRmVMAccessExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet removes VMAccess for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the extension that this cmdlet removes. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet removes VMAccess for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the extension that this cmdlet removes. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Get-AzureRmVMAccessExtension - - - - Set-AzureRmVMAccessExtension - - - - Remove-AzureRmVMExtension - - - - - - - - Remove-AzureRmVMAEMExtension - - Removes the AEM extension from a virtual machine. - - - - - Remove - AzureRmVMAEMExtension - - - - The Remove-AzureRmVMAEMExtension cmdlet removes the Azure Enhanced Monitoring (AEM) extension from a virtual machine. - - - - Remove-AzureRmVMAEMExtension - - ResourceGroupName - - Specifies the name of the resource group of a virtual machine. This cmdlet removes the AEM extension from that virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet removes the AEM extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the virtual machine from which this cmdlet removes the AEM extension. - - String - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of a virtual machine. This cmdlet removes the AEM extension from that virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet removes the AEM extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the virtual machine from which this cmdlet removes the AEM extension. - - String - - String - - - none - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove the AEM extension -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" - - This command removes the AEM extension for the virtual machine named contoso-server. - - - - - - - - - - - - - - - - Get-AzureRmVMAEMExtension - - - - Set-AzureRmVMAEMExtension - - - - Test-AzureRmVMAEMExtension - - - - - - - - Remove-AzureRmVMBackup - - - - - - - Remove - AzureRmVMBackup - - - - - - - - Remove-AzureRmVMBackup - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Tag - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Tag - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Remove-AzureRmVMCustomScriptExtension - - Removes a custom script extension from a virtual machine. - - - - - Remove - AzureRmVMCustomScriptExtension - - - - The Remove-AzureRmVMCustomScriptExtension cmdlet removes a custom script Virtual Machine Extension from a virtual machine. - - - - Remove-AzureRmVMCustomScriptExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the custom script extension. - - String - - - Name - - Specifies the name of the custom script extension that this cmdlet removes. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the custom script extension. - - String - - String - - - none - - - Name - - Specifies the name of the custom script extension that this cmdlet removes. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Get-AzureRmVMCustomScriptExtension - - - - Set-AzureRmVMCustomScriptExtension - - - - - - - - Remove-AzureRmVMDataDisk - - Removes a data disk from a virtual machine. - - - - - Remove - AzureRmVMDataDisk - - - - The Remove-AzureRmVMDataDisk cmdlet removes a data disk from a virtual machine. - - - - Remove-AzureRmVMDataDisk - - VM - - Specifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - DataDiskNames - - Specifies the names of one or more data disks that this cmdlet removes. - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - DataDiskNames - - Specifies the names of one or more data disks that this cmdlet removes. - - String[] - - String[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove a data disk from a virtual machine -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -PS C:\> Remove-AzureRmVMDataDisk -VM $VirtualMachine -Name "Disk3" -PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine - - The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. - - - - - - - - - - - - - - - - Add-AzureRmVMDataDisk - - - - Get-AzureRmVM - - - - - - - - Remove-AzureRmVMDiagnosticsExtension - - - - - - - Remove - AzureRmVMDiagnosticsExtension - - - - - - - - Remove-AzureRmVMDiagnosticsExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Remove-AzureRmVMDiskEncryptionExtension - - Removes the disk encryption extension from a virtual machine. - - - - - Remove - AzureRmVMDiskEncryptionExtension - - - - The Remove-AzureRmVMDiskEncryptionExtension cmdlet removes the disk encryption extension from a virtual machine. If no extension name is specified, this cmdlet removes the extension with default name AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux based virtual machines. This cmdlet does not disable encryption on the virtual machine. It removes the extension and the associated extension configuration from the virtual machine. - - - - Remove-AzureRmVMDiskEncryptionExtension - - ResourceGroupName - - Specifies the name of the resource group for the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDiskEncryptionExtension cmdlet sets this name to AzureDiskEncryption for virtual machines that run the Windows operating system and AzureDiskEncryptionForLinux for Linux virtual machines. Specify this parameter only if you changed the default name in the Set-AzureRmVMDiskEncryptionExtension cmdlet or used a different resource name in a Resource Manager template. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group for the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine. - - String - - String - - - none - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDiskEncryptionExtension cmdlet sets this name to AzureDiskEncryption for virtual machines that run the Windows operating system and AzureDiskEncryptionForLinux for Linux virtual machines. Specify this parameter only if you changed the default name in the Set-AzureRmVMDiskEncryptionExtension cmdlet or used a different resource name in a Resource Manager template. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove the disk encryption extension from a virtual machine. -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName "MyResourceGroup" -VMName "MyTestVM" - - This command removes the extension with default name AzureDiskEncryption for a virtual machine that runs the Windows operating system or AzureDiskEncryptionForLinux for Linux based virtual machine named MyTestVM. - - - - - - - - - - - - - - -------------------------- Example 2: Remove a specific disk encryption extension from a virtual machine. -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName "MyResourceGroup" -VMName "MyTestVM" -Name "MyDiskEncryptionExtension" - - This command removes the encryption extension named MyDiskEncryptionExtension from the virtual machine named MyTestVM. - - - - - - - - - - - - - - - - Get-AzureRmVMDiskEncryptionStatus - - - - Set-AzureRmVMDiskEncryptionExtension - - - - - - - - Remove-AzureRmVMDscExtension - - Removes a DSC extension handler from a virtual machine in a resource group. - - - - - Remove - AzureRmVMDscExtension - - - - The Remove-AzureRmVMDscExtension cmdlet removes a Desired State Configuration (DSC) extension handler from a virtual machine in a resource group. - - - - Remove-AzureRmVMDscExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the DSC extension. - - String - - - Name - - Specifies the name of the DSC extension that this cmdlet removes. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the default value used by Remove-AzureRmVMDscExtension. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the DSC extension. - - String - - String - - - none - - - Name - - Specifies the name of the DSC extension that this cmdlet removes. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the default value used by Remove-AzureRmVMDscExtension. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - false - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove a DSC extension -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVMDscExtension -ResouceGroupName "ResourceGroup001" -VMName "VM07" -Name "DSC" - - This command removes the extension named DSC on virtual machine named VM07. - - - - - - - - - - - - - - - - Get-AzureRmVMDscExtension - - - - Set-AzureRmVMDscExtension - - - - - - - - Remove-AzureRmVMExtension - - Removes an extension from a virtual machine. - - - - - Remove - AzureRmVMExtension - - - - The Remove-AzureRmVMExtension cmdlet removes an extension from the Virtual Machine Extensions of a virtual machine. - - - - Remove-AzureRmVMExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the extension. - - String - - - Name - - Specifies the name of the extension that this cmdlet removes. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine from which this cmdlet removes the extension. - - String - - String - - - none - - - Name - - Specifies the name of the extension that this cmdlet removes. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove an extension from a virtual machine -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Name "ContosoTest" -VMName "VirtualMachine22" - - This command removes the extension named ContosoTest from the virtual machine named VirtualMachine22 in ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmVMExtension - - - - Set-AzureRmVMExtension - - - - - - - - Remove-AzureRmVMNetworkInterface - - Removes a network interface from a virtual machine. - - - - - Remove - AzureRmVMNetworkInterface - - - - The Remove-AzureRmVMNetworkInterface cmdlet removes a network interface from a virtual machine. - - - - Remove-AzureRmVMNetworkInterface - - VM - - Specifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - NetworkInterfaceIDs - - Specifies an array of network interface IDs that this cmdlet removes. - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - NetworkInterfaceIDs - - Specifies an array of network interface IDs that this cmdlet removes. - - String[] - - String[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - - - - - Remove-AzureRmVMSqlServerExtension - - - - - - - Remove - AzureRmVMSqlServerExtension - - - - - - - - Remove-AzureRmVMSqlServerExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Remove-AzureRmVmss - - Removes the VMSS or a virtual machine that is within the VMSS. - - - - - Remove - AzureRmVmss - - - - The Remove-AzureRmVmss cmdlet removes the Virtual Machine Scale Set (VMSS) from Azure. This cmdlet can also be used to remove a specific virtual machine inside the VMSS. You can use the InstanceId parameter to remove a specific virtual machine inside the VMSS. - - - - Remove-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group that the VMSS belongs to. - - String - - - VMScaleSetName - - Species the name of the VMSS that this cmdlet removes. If you specify the InstanceId parameter, the cmdlet will remove the specified virtual machine from the VMSS named by this parameter. - - String - - - InstanceId - - Specifies, as a string array, the ID of the instances that need to be started. For instance: -InstanceId "0", "3" - - String[] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group that the VMSS belongs to. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS that this cmdlet removes. If you specify the InstanceId parameter, the cmdlet will remove the specified virtual machine from the VMSS named by this parameter. - - String - - String - - - none - - - InstanceId - - Specifies, as a string array, the ID of the instances that need to be started. For instance: -InstanceId "0", "3" - - String[] - - String[] - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove a VMSS -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMScaleSet001" - - This command removes the VMSS named VMScaleSet001 that belongs to the resource group named Group001. - - - - - - - - - - - - - - -------------------------- Example 2: Remove a virtual machine from within a VMSS -------------------------- - - PS C:\> - - PS C:\>Remove-AzureRmVmss -ResourceGroupName "Group002" -VMScaleSetName "VMScaleSet002" -InstanceId "3"; - - This command removes the virtual machine with instance ID 3 from the VMSS named VMScaleSet002 that belongs to the resource group named Group002. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Set-AzureRmVmss - - - - Start-AzureRmVmss - - - - Stop-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Remove-AzureRmVmssExtension - - Removes an extension from the VMSS. - - - - - Remove - AzureRmVmssExtension - - - - The Remove-AzureRmVmssExtension cmdlet removes an extension from the Virtual Machine Scale Set (VMSS). - - - - Remove-AzureRmVmssExtension - - VirtualMachineScaleSet - - Specifies the VMSS from which to remove the extension from. - - VirtualMachineScaleSet - - - Name - - Specifies the name of the extension that this cmdlet removes from the VMSS. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS from which to remove the extension from. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Name - - Specifies the name of the extension that this cmdlet removes from the VMSS. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Add-AzureRmVmssExtension - - - - - - - - Remove-AzureRmVmssNetworkInterfaceConfiguration - - - - - - - Remove - AzureRmVmssNetworkInterfaceConfiguration - - - - - - - - Remove-AzureRmVmssNetworkInterfaceConfiguration - - VirtualMachineScaleSet - - - - VirtualMachineScaleSet - - - Name - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - Name - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Restart-AzureRmVM - - Restarts an Azure virtual machine. - - - - - Restart - AzureRmVM - - - - The Restart-AzureRmVM cmdlet restarts an Azure virtual machine. - - - - Restart-AzureRmVM - - Name - - Specifies the name of the virtual machine to restart. - - String - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Restart-AzureRmVM - - Name - - Specifies the name of the virtual machine to restart. - - String - - - Id - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Name - - Specifies the name of the virtual machine to restart. - - String - - String - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Id - - - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Restart a virtual machine -------------------------- - - PS C:\> - - PS C:\>Restart-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" - - This command restarts the virtual machine named VirtualMachine07 in ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVM - - - - Remove-AzureRmVM - - - - Start-AzureRmVM - - - - Stop-AzureRmVM - - - - Update-AzureRmVM - - - - - - - - Restart-AzureRmVmss - - Restarts the VMSS or a virtual machine within the VMSS. - - - - - Restart - AzureRmVmss - - - - The Restart-AzureRmVmss cmdlet restarts the Virtual Machine Scale Set (VMSS). This cmdlet can also be used to restart a specific virtual machine inside the VMSS by using the InstanceId parameter. - - - - Restart-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS that this cmdlet restarts. - - String - - - InstanceId - - Specifies, as a string array, the ID of the instances that need restarted. - - String[] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS that this cmdlet restarts. - - String - - String - - - none - - - InstanceId - - Specifies, as a string array, the ID of the instances that need restarted. - - String[] - - String[] - - - none - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Restart the VMSS -------------------------- - - PS C:\> - - PS C:\>Restart-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMSS001"; - - This command restarts the VMSS named VMSS001 that belongs to the resource group named Group001. - - - - - - - - - - - - - - -------------------------- Example 2: Restart a specific virtual machine within the VMSS -------------------------- - - PS C:\> - - PS C:\>Restart-AzureRmVmss -ResourceGroupName "Group004" -VMScaleSetName "VMSS001" -InstanceId "1" - - This command restarts a virtual machine that has the instance ID of 1 in the VMSS named VMSS001 that belongs to the resource group named Group001. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Set-AzureRmVmss - - - - Start-AzureRmVmss - - - - Stop-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Save-AzureRmVhd - - Enables download of .vhd disks from Azure to your device - - - - - Save - AzureRmVhd - - - - Enables download of .vhd disks from Azure to your device - - - - Save-AzureRmVhd - - ResourceGroupName - - Resource Group of the storage account with the VHD - - String - - - SourceUri - - Uri of the VHD to be downloaded - - Uri - - - LocalFilePath - - Local file path where the VHD should be saved - - FileInfo - - - NumberOfThreads - - Specifies the number of download threads that this cmdlet uses during download. - - Int32 - - - OverWrite - - Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Save-AzureRmVhd - - StorageKey - - Specifies the storage key of the blob storage account. If it is not provided, Save-AzureVhd attempts to determine the storage key of the account in SourceUri from Azure. - - String - - - SourceUri - - Uri of the VHD to be downloaded - - Uri - - - LocalFilePath - - Local file path where the VHD should be saved - - FileInfo - - - NumberOfThreads - - Specifies the number of download threads that this cmdlet uses during download. - - Int32 - - - OverWrite - - Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the storage account with the VHD - - String - - String - - - none - - - SourceUri - - Uri of the VHD to be downloaded - - Uri - - Uri - - - none - - - LocalFilePath - - Local file path where the VHD should be saved - - FileInfo - - FileInfo - - - none - - - NumberOfThreads - - Specifies the number of download threads that this cmdlet uses during download. - - Int32 - - Int32 - - - none - - - OverWrite - - Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - StorageKey - - Specifies the storage key of the blob storage account. If it is not provided, Save-AzureVhd attempts to determine the storage key of the account in SourceUri from Azure. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Save-AzureVhd -ResourceGroupName "myrg" -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - Save-AzureVhd -ResourceGroupName "myrg" -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -Overwrite - - - - - - - - - - - - - - - - -------------------------- Example 3 -------------------------- - - PS C:\> - - Save-AzureVhd -ResourceGroupName "myrg" -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32 - - - - - - - - - - - - - - - - -------------------------- Example 4 -------------------------- - - PS C:\> - - Save-AzureVhd -ResourceGroupName "myrg" -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -StorageKey - "zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw==" - - - - - - - - - - - - - - - - - - - - - - Save-AzureRmVMImage - - Saves a virtual machine as a VMImage. - - - - - Save - AzureRmVMImage - - - - The Save-AzureRmVMImage cmdlet saves a virtual machine as a VMImage. Before you create a virtual machine image, sysprep the virtual machine, and then mark it as generalized by using the Set-AzureRmVM cmdlet. - The output of this cmdlet is a JavaScript Object Notation (JSON) template. You can deploy virtual machines from your captured image. - - - - Save-AzureRmVMImage - - Name - - - - String - - - DestinationContainerName - - Specifies the name of a container. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. - - String - - - VHDNamePrefix - - Specifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for operating system disk results in the name vhdPrefix-osdisk. - - String - - - Overwrite - - Indicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. - - SwitchParameter - - - Path - - Specifies the path of the VHD. - - String - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Save-AzureRmVMImage - - Name - - - - String - - - DestinationContainerName - - Specifies the name of a container. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. - - String - - - VHDNamePrefix - - Specifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for operating system disk results in the name vhdPrefix-osdisk. - - String - - - Overwrite - - Indicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. - - SwitchParameter - - - Path - - Specifies the path of the VHD. - - String - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Name - - - - String - - String - - - none - - - DestinationContainerName - - Specifies the name of a container. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. - - String - - String - - - none - - - VHDNamePrefix - - Specifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for operating system disk results in the name vhdPrefix-osdisk. - - String - - String - - - none - - - Overwrite - - Indicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. - - SwitchParameter - - SwitchParameter - - - none - - - Path - - Specifies the path of the VHD. - - String - - String - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Capture a virtual machine -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized -PS C:\> Save-AzureRmVMImage -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -DestinationContainerName "VMContainer01" -VHDNamePrefix "VM07" - - The first command marks the virtual machine named VirtualMachine07 as generalized. - - - - - - - - - - - - - - - - Get-AzureRmVMImage - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageSku - - - - Set-AzureRmVM - - - - - - - - Set-AzureRmVM - - Marks a virtual machine as generalized. - - - - - Set - AzureRmVM - - - - The Set-AzureRmVM cmdlet marks a virtual machine as generalized. Before you run this cmdlet, log on to the virtual machine and use Sysprep to prepare the hard disk. - - - - Set-AzureRmVM - - Name - - Specifies the name of the virtual machine on which this cmdlet operates. - - String - - - Generalized - - Indicates that this cmdlet marks a virtual machine as generalized. - - SwitchParameter - - - Redeploy - - Indicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. - If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data. - - SwitchParameter - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVM - - Name - - Specifies the name of the virtual machine on which this cmdlet operates. - - String - - - Generalized - - Indicates that this cmdlet marks a virtual machine as generalized. - - SwitchParameter - - - Redeploy - - Indicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. - If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data. - - SwitchParameter - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Name - - Specifies the name of the virtual machine on which this cmdlet operates. - - String - - String - - - none - - - Generalized - - Indicates that this cmdlet marks a virtual machine as generalized. - - SwitchParameter - - SwitchParameter - - - none - - - Redeploy - - Indicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. - If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data. - - SwitchParameter - - SwitchParameter - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Mark a virtual machine as generalized -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized - - This command marks the virtual machine named VirtualMachine07 as generalized. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - - - - - Set-AzureRmVMAccessExtension - - Adds the VMAccess extension to a virtual machine. - - - - - Set - AzureRmVMAccessExtension - - - - The Set-AzureRmVMAccessExtension cmdlet adds the Virtual Machine Access (VMAccess) Virtual Machine Extension to a virtual machine. VMAccess can reset the virtual machine user name and password. - - - - Set-AzureRmVMAccessExtension - - UserName - - Specifies the new user name for the virtual machine. - - String - - - Password - - Specifies the new password of the virtual machine. - - String - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the extension that this cmdlet adds. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - ForceRerun - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - UserName - - Specifies the new user name for the virtual machine. - - String - - String - - - none - - - Password - - Specifies the new password of the virtual machine. - - String - - String - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the extension that this cmdlet adds. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - String - - - none - - - Location - - Specifies the location of the virtual machine. - - String - - String - - - none - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - SwitchParameter - - - - - - ForceRerun - - - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a VMAccess extension -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMAccessExtension -ResourceGroupName "ResrouceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "2.0" -UserName "PFuller" -Password "Password" - - This command adds a VMAccess extension for the virtual machine named VirtualMachine07 in ResrouceGroup11. The command specifies the name and type handler version for VMAccess. - - - - - - - - - - - - - - - - Get-AzureRmVMAccessExtension - - - - Remove-AzureRmVMAccessExtension - - - - Set-AzureRmVMExtension - - - - Get-AzureRmVMExtensionImage - - - - - - - - Set-AzureRmVMADDomainExtension - - Adds an AD Domain extension to a virtual machine. - - - - - Set - AzureRmVMADDomainExtension - - - - The Set-AzureRmVMADDomainExtension cmdlet adds an AD Domain Virtual Machine Extension to a virtual machine. This extension lets your virtual machine join a domain. - - - - Set-AzureRmVMADDomainExtension - - DomainName - - - - String - - - OUPath - - - - String - - - JoinOption - - - - Nullable`1[UInt32] - - - Credential - - - - PSCredential - - - Restart - - - - SwitchParameter - - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - TypeHandlerVersion - - - - String - - - Location - - - - String - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - ForceRerun - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - DomainName - - - - String - - String - - - - - - OUPath - - - - String - - String - - - - - - JoinOption - - - - Nullable`1[UInt32] - - Nullable`1[UInt32] - - - - - - Credential - - - - PSCredential - - PSCredential - - - - - - Restart - - - - SwitchParameter - - SwitchParameter - - - - - - ResourceGroupName - - - - String - - String - - - - - - VMName - - - - String - - String - - - - - - Name - - - - String - - String - - - - - - TypeHandlerVersion - - - - String - - String - - - - - - Location - - - - String - - String - - - - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - SwitchParameter - - - - - - ForceRerun - - - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set-AzureRmVMAEMExtension - - Enables support for monitoring for SAP systems. - - - - - Set - AzureRmVMAEMExtension - - - - The Set-AzureRmVMAEMExtension cmdlet updates the configuration of a virtual machine to enable or update the support for monitoring for SAP systems that are installed on the virtual machine. The cmdlet installs the Azure Enhanced Monitoring (AEM) extension that collects the performance data and makes it discoverable for the SAP system. - - - - Set-AzureRmVMAEMExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine that this cmdlet modifies. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the AEM extension for the virtual machine that this parameter specifies. - - String - - - DisableWAD - - Indicates that this cmdlet does not enable Azure Diagnostics for the virtual machine. - - SwitchParameter - - - WADStorageAccountName - - Specifies the name of the storage account that this cmdlet uses to configure the LinuxDiagnostics or IaaSDiagnostics extension. If the virtual machine does not use a standard storage account, you must specify a value for this parameter. - - String - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - - SkipStorage - - Indicates that this cmdlet skips configuration of storage. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine that this cmdlet modifies. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the AEM extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - DisableWAD - - Indicates that this cmdlet does not enable Azure Diagnostics for the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - WADStorageAccountName - - Specifies the name of the storage account that this cmdlet uses to configure the LinuxDiagnostics or IaaSDiagnostics extension. If the virtual machine does not use a standard storage account, you must specify a value for this parameter. - - String - - String - - - none - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - String - - - none - - - SkipStorage - - Indicates that this cmdlet skips configuration of storage. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Use AEM extension -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" -WADStorageAccountName "stdstorage" - - This command configures the virtual machine named contoso-server to use the AEM extension. The command specifies the storage account named stdstorage. - - - - - - - - - - - - - - - - Get-AzureRmVMAEMExtension - - - - Remove-AzureRmVMAEMExtension - - - - Test-AzureRmVMAEMExtension - - - - - - - - Set-AzureRmVMBackupExtension - - - - - - - Set - AzureRmVMBackupExtension - - - - - - - - Set-AzureRmVMBackupExtension - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - Tag - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - Tag - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Set-AzureRmVMBginfoExtension - - Adds the BGInfo extension to a virtual machine. - - - - - Set - AzureRmVMBginfoExtension - - - - The Set-AzureRmVMBGInfoExtension cmdlet adds the BGInfo extension to a virtual machine. - - - - Set-AzureRmVMBginfoExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine to which this cmdlet adds an extension. - - String - - - VMName - - Specifies the name of the virtual machine to which this cmdlet adds the BGInfo extension. - - String - - - Name - - Specifies the name of the BGInfo extension that this cmdlet adds to a virtual machine. - - String - - - TypeHandlerVersion - - Specifies the version of the extension that this cmdlet adds to the virtual machine. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extension to a newer minor version. By default, this cmdlet enables the guest agent to update the extension. - - SwitchParameter - - - ForceRerun - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine to which this cmdlet adds an extension. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine to which this cmdlet adds the BGInfo extension. - - String - - String - - - none - - - Name - - Specifies the name of the BGInfo extension that this cmdlet adds to a virtual machine. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension that this cmdlet adds to the virtual machine. - - String - - String - - - none - - - Location - - Specifies the location of the virtual machine. - - String - - String - - - none - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extension to a newer minor version. By default, this cmdlet enables the guest agent to update the extension. - - SwitchParameter - - SwitchParameter - - - none - - - ForceRerun - - - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add the BGInfo extension for a virtual machine -------------------------- - - PS C:\> - - PS C:\>Set-AzureVMBGInfoExtension -ResrouceGroupName "ContosoRG" -VMName "ContosoVM" -Name "ExtensionName" -TypeHandlerVersion "2.1" -Location "West Europe" - - This command adds the BGInfo extension to virtual machine named ContosoVM. The command specifies the resource group and location of the virtual machine. The command specifies the name and version of the extension. - - - - - - - - - - - - - - - - - - - - Set-AzureRmVMBootDiagnostics - - Set Virtual Machine boot diagnostics properties - - - - - Set - AzureRmVMBootDiagnostics - - - - This cmdlet allows changing the Virtual Machine boot diagnostics properties - - - - Set-AzureRmVMBootDiagnostics - - VM - - Virtual Machine object to change the boot diagnostics on - - PSVirtualMachine - - - Enable - - Enable the boot diagnostics - - SwitchParameter - - - ResourceGroupName - - Resource Group name of the Virtual Machine - - String - - - StorageAccountName - - Name of the storage account to save the boot diagnostics data in - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMBootDiagnostics - - VM - - Virtual Machine object to change the boot diagnostics on - - PSVirtualMachine - - - Disable - - Disable the boot diagnostics - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Virtual Machine object to change the boot diagnostics on - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Enable - - Enable the boot diagnostics - - SwitchParameter - - SwitchParameter - - - none - - - ResourceGroupName - - Resource Group name of the Virtual Machine - - String - - String - - - none - - - StorageAccountName - - Name of the storage account to save the boot diagnostics data in - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Disable - - Disable the boot diagnostics - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - Set-AzureRMVMBootDiagnostics -VM $p -Enable -ResourceGroupName $rgname -StorageAccountName $stoname2; - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - - - Set-AzureRmVMChefExtension - - Adds a chef extension to a virtual machine. - - - - - Set - AzureRmVMChefExtension - - - - The Set-AzureVMChefExtension cmdlet adds the Chef extension to the virtual machine. - - - - Set-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the chef extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String - - - BootstrapOptions - - It overrides the configuration set in client_rb option. for e.g. node_name option i.e. if you set node_name as "foo" in the client_rb and in bootstrap_option you set chef_node_name as "bar" it will take "bar" as node name instead of "foo". - - String - - - ChefServerUrl - - Chef server URL - - String - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - RunList - - Specifies the Chef node run list. - - String - - - ValidationClientName - - - - String - - - Windows - - Indicates that this cmdlet creates a Windows virtual machine. - - SwitchParameter - - - - Set-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the chef extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String - - - BootstrapOptions - - It overrides the configuration set in client_rb option. for e.g. node_name option i.e. if you set node_name as "foo" in the client_rb and in bootstrap_option you set chef_node_name as "bar" it will take "bar" as node name instead of "foo". - - String - - - ChefServerUrl - - Chef server URL - - String - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - RunList - - Specifies the Chef node run list. - - String - - - ValidationClientName - - - - String - - - Linux - - Indicates that this cmdlet creates a Windows virtual machine. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the chef extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the chef extension. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine - - String - - String - - - none - - - BootstrapOptions - - It overrides the configuration set in client_rb option. for e.g. node_name option i.e. if you set node_name as "foo" in the client_rb and in bootstrap_option you set chef_node_name as "bar" it will take "bar" as node name instead of "foo". - - String - - String - - - none - - - ChefServerUrl - - - - String - - String - - - none - - - ClientRb - - Specifies the full path of the Chef client.rb. - - String - - String - - - none - - - Linux - - Indicates that this cmdlet creates a Linux based virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - OrganizationName - - Specifies the organization name of the Chef extension. - - String - - String - - - none - - - RunList - - Specifies the Chef node run list. - - String - - String - - - none - - - ValidationClientName - - - - String - - String - - - none - - - ValidationPem - - Specifies the Chef validator .pem file path - - String - - String - - - none - - - Windows - - Indicates that this cmdlet creates a Windows virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - Location - - Specifies the location of the VM. - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -----Example 1: Add a Chef extension to a Windows virtual machine----- - - PS C:\> - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -RunList "Apache" -Windows; - - This command adds a Chef extension to a Windows virtual machine. When the virtual machine comes up, it is bootstrapped with Chef and runs Apache on it. - - - - - - - - - - - - - - -----Example 2: Add a Chef extension to a Linux virtual machine----- - - - - - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -RunList "Apache" -Linux; - - - This command adds a Chef extension to a Linux virtual machine. When the virtual machine comes up, it is bootstrapped with Chef and runs Apache on it. - - - - - - - - - - - - - - Example 3: Add a Chef extension to a Windows virtual machine with bootstrap options - - - - - - PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -BootstrapOptions '{"chef_node_name":"your_node_name","chef_server_url":"https://api.opscode.com/organizations/some-org", "validation_client_name":"some-org-validator"}' -RunList "Apache" -Windows; - - - This command adds the Chef extension to a Windows virtual machine. When the virtual machine launches, it is bootstrapped with Chef and runs Apache on it. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format. - - - - - - - - - - - - - Get-AzureRmVMChefExtension - - - - Remove-AzureRmVMChefExtension - - - - - - - - Get-AzureRmVMChefExtension - - Gets the information about chef extension. - - - - - Get - AzureRmVMChefExtension - - - - The Get-AzureVMChefExtension cmdlet gets the information about Chef extension installed on a virtual machine. - - - - Get-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - Windows - - Indicates that this cmdlet is for Windows virtual machine. - - SwitchParameter - - - - Get-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - Linux - - Indicates that this cmdlet works on a Linux virtual machine. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. - - String - - String - - - none - - - Name - - Specifies the name of the chef extension. - - String - - String - - - none - - - Linux - - Indicates that this cmdlet is for a Linux based virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - Windows - - Indicates that this cmdlet is for a Windows virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -----Example 1: Get the details of Chef extension for a Windows virtual machine----- - - PS C:\> - - PS C:\>Get-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -Windows; - - - - - - - - - - - - - - - - -----Example 2: Get the details of Chef extension for a Linux virtual machine----- - - - - - - PS C:\>Get-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -Linux; - - - - - - - - - - - - - - - - - - - Set-AzureRmVMChefExtension - - - - Remove-AzureRmVMChefExtension - - - - - - - - Remove-AzureRmVMChefExtension - - Removes the Chef extension from a Virtual machine. - - - - - Remove - AzureRmVMChefExtension - - - - The Remove-AzureVMChefExtension cmdlet removes the Chef extension from a Virtual machine.. - - - - Remove-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - Windows - - Indicates that this cmdlet is for Windows virtual machine. - - SwitchParameter - - - - Remove-AzureRmVMChefExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. - - String - - - Name - - Specifies the name of the chef extension. - - String - - - Linux - - Indicates that this cmdlet works on a Linux virtual machine. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. - - String - - String - - - none - - - Name - - Specifies the name of the chef extension. - - String - - String - - - none - - - Linux - - Indicates that this cmdlet is for a Linux based virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - Windows - - Indicates that this cmdlet is for a Windows virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -----Example 1: Remove Chef extension from a Windows virtual machine----- - - PS C:\> - - PS C:\>Remove-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -Windows; - - - - - - - - - - - - - - - - -----Example 2: Remove Chef extension from a Linux virtual machine----- - - - - - - PS C:\>Remove-AzureRmVMChefExtension -ResourceGroupName $ResourceGrpName -VMName $VMName -Linux; - - - - - - - - - - - - - - - - - - - Set-AzureRmVMChefExtension - - - - Get-AzureRmVMChefExtension - - - - - - - - Set-AzureRmVMCustomScriptExtension - - Adds a custom script extension to a virtual machine. - - - - - Set - AzureRmVMCustomScriptExtension - - - - The Set-AzureRmVMCustomScriptExtension cmdlet adds a custom script Virtual Machine Extension to a virtual machine. This extension lets you run your own scripts on the virtual machine. - - - - Set-AzureRmVMCustomScriptExtension - - ContainerName - - Specifies the name of the Azure storage container where this cmdlet stores the script. - - String - - - FileName - - Specifies the name of the script file. - - String[] - - - StorageAccountName - - Specifies the name of the Azure storage account where this cmdlet stores the script. - - String - - - StorageEndpointSuffix - - Specifies the storage endpoint suffix. - - String - - - StorageAccountKey - - Specifies the key for the Azure storage container. - - String - - - Run - - Specifies the command to use that runs your script. - - String - - - Argument - - Specifies arguments that the script extension passes to the script. - - String - - - SecureExecution - - Indicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely. - - SwitchParameter - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the custom script extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - ForceRerun - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMCustomScriptExtension - - FileUri - - Specifies the URI of the script file. - - String[] - - - Run - - Specifies the command to use that runs your script. - - String - - - Argument - - Specifies arguments that the script extension passes to the script. - - String - - - SecureExecution - - Indicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely. - - SwitchParameter - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of the custom script extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - ForceRerun - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ContainerName - - Specifies the name of the Azure storage container where this cmdlet stores the script. - - String - - String - - - none - - - FileName - - Specifies the name of the script file. - - String[] - - String[] - - - none - - - StorageAccountName - - Specifies the name of the Azure storage account where this cmdlet stores the script. - - String - - String - - - none - - - StorageEndpointSuffix - - Specifies the storage endpoint suffix. - - String - - String - - - none - - - StorageAccountKey - - Specifies the key for the Azure storage container. - - String - - String - - - none - - - Run - - Specifies the command to use that runs your script. - - String - - String - - - none - - - Argument - - Specifies arguments that the script extension passes to the script. - - String - - String - - - none - - - SecureExecution - - Indicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely. - - SwitchParameter - - SwitchParameter - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of the custom script extension. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - String - - - none - - - Location - - Specifies the location of the virtual machine. - - String - - String - - - none - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - SwitchParameter - - - - - - ForceRerun - - - - String - - String - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - FileUri - - Specifies the URI of the script file. - - String[] - - String[] - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add a custom script -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "1.1" -StorageAccountName "Contoso" -StorageAccountKey <StorageKey> -FileName "ContosoScript.exe" -ContainerName "Scripts" - - This command adds a custom script to the virtual machine named VirtualMachine07. The script file is contososcript.exe. - - - - - - - - - - - - - - - - Get-AzureRmVMCustomScriptExtension - - - - Remove-AzureRmVMCustomScriptExtension - - - - - - - - Set-AzureRmVMDataDisk - - Change Virtual Machine data disk properties - - - - - Set - AzureRmVMDataDisk - - - - This cmdlet allows changing the Virtual Machine data disk properties - - - - Set-AzureRmVMDataDisk - - VM - - Specifies the local virtual machine object for which to update a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the data disk to update. - - String - - - Caching - - Specifies the caching mode of the disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing this value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - DiskSizeInGB - - Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMDataDisk - - VM - - Specifies the local virtual machine object for which to update a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Lun - - Specifies the logical unit number (LUN) for a data disk. - - Nullable`1[Int32] - - - Caching - - Specifies the caching mode of the disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing this value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - DiskSizeInGB - - Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object for which to update a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Name - - Specifies the name of the data disk to update. - - String - - String - - - none - - - Caching - - Specifies the caching mode of the disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing this value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - Nullable`1[CachingTypes] - - - none - - - DiskSizeInGB - - Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Lun - - Specifies the logical unit number (LUN) for a data disk. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\>$VM = Get-AzureRMVM -ResourceGroupName "TestRG" -Name "MyWindowsVM" -PS C:\> Set-AzureRmVMDataDisk -VM $VM -Name "TestDatDisk1" -Caching ReadWrite | Update-AzureRMVM - - - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - - - - - Set-AzureRmVMDiagnosticsExtension - - Configures the Azure diagnostics extension on a virtual machine. - - - - - Set - AzureRmVMDiagnosticsExtension - - - - The Set-AzureRmVMDiagnosticsExtension cmdlet configures the Azure diagnostics extension on a virtual machine. - - - - Set-AzureRmVMDiagnosticsExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine on which this cmdlet operates. - - String - - - DiagnosticsConfigurationPath - - Specifies the path of the configuration file. - - String - - - StorageAccountName - - Specifies the storage account name. - - String - - - StorageAccountKey - - Specifies the storage account key. - - String - - - StorageAccountEndpoint - - Specifies the storage account endpoint. - - String - - - StorageContext - - Specifies the Azure storage context. - - AzureStorageContext - - - Location - - Specifies the location of the virtual machine. - - String - - - Name - - Specifies the name of an extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - - AutoUpgradeMinorVersion - - Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version. - - Boolean - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine on which this cmdlet operates. - - String - - String - - - none - - - DiagnosticsConfigurationPath - - Specifies the path of the configuration file. - - String - - String - - - none - - - StorageAccountName - - Specifies the storage account name. - - String - - String - - - none - - - StorageAccountKey - - Specifies the storage account key. - - String - - String - - - none - - - StorageAccountEndpoint - - Specifies the storage account endpoint. - - String - - String - - - none - - - StorageContext - - Specifies the Azure storage context. - - AzureStorageContext - - AzureStorageContext - - - none - - - Location - - Specifies the location of the virtual machine. - - String - - String - - - none - - - Name - - Specifies the name of an extension. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. - - String - - String - - - none - - - AutoUpgradeMinorVersion - - Indicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version. - - Boolean - - Boolean - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Enable diagnostics using a storage account specified in a diagnostics configuration file -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath "diagnostics_publicconfig.xml" - - This command uses a diagnostics configuration file to enable diagnostics. The file diagnostics_publicconfig.xml contains the public XML configuration for the diagnostics extension including the name of the storage account to which diagnostics data will be sent. The diagnostics storage account must be in the same subscription as the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 2: Enable diagnostics using a storage account name -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup1" -VMName "VirtualMachine2" -DiagnosticsConfigurationPath diagnostics_publicconfig.xml -StorageAccountName "MyStorageAccount" - - This command uses the storage account name to enable diagnostics. If the diagnostics configuration does not specify a storage account name or if you want to override the diagnostics storage account name specified in the configuration file, use the StorageAccountName parameter. The diagnostics storage account must be in the same subscription as the virtual machine. - - - - - - - - - - - - - - -------------------------- Example 3: Enable diagnostics using storage account name and key -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath "diagnostics_publicconfig.xml" -StorageAccountName "MyStorageAccount" -StorageAccountKey $storage_key - - This command uses the storage account name and key to enable diagnostics. If the diagnostics storage account is in a different subscription than the virtual machine then enable sending diagnostics data to that storage account by explicitly specifying its name and key. - - - - - - - - - - - - - - - - Get-AzureRmVMDiagnosticsExtension - - - - Get-AzureRmVMExtensionImage - - - - Remove-AzureRmVMDiagnosticsExtension - - - - - - - - Set-AzureRmVMDiskEncryptionExtension - - Enables encryption on a running IaaS virtual machine in Azure. - - - - - Set - AzureRmVMDiskEncryptionExtension - - - - The Set-AzureRmVMDiskEncryptionExtension cmdlet enables encryption on a running infrastructure as a service (IaaS) virtual machine in Azure. This cmdlet enables encryption by installing the disk encryption extension on the virtual machine. If no Name parameter is specified, an extension with the default name AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines are installed. This cmdlet requires confirmation from the users as one of the steps to enable encryption requires a restart of the virtual machine. It is advised that you save your work on the virtual machine before you run this cmdlet. - - - - Set-AzureRmVMDiskEncryptionExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine. - - String - - - AadClientID - - Specifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault. - - String - - - AadClientSecret - - Specifies the client secret of the Azure AD application that has permissions to write secrets to KeyVault. - - String - - - DiskEncryptionKeyVaultUrl - - Specifies the KeyVault URL to which the virtual machine encryption keys should be uploaded. - - String - - - DiskEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded. - - String - - - KeyEncryptionKeyUrl - - Specifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. - - String - - - KeyEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. - - String - - - KeyEncryptionAlgorithm - - Specifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP. - - String - - - VolumeType - - Specifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only. - - String - - - SequenceVersion - - Specifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used. - - String - - - TypeHandlerVersion - - Specifies the version of the encryption extension. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines. - - String - - - Passphrase - - Specifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - Set-AzureRmVMDiskEncryptionExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine. - - String - - - AadClientID - - Specifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault. - - String - - - AadClientCertThumbprint - - Specifies the thumbprint of the AzureActive Directory (Azure AD) application client certificate that has permissions to write secrets to KeyVault. As a prerequisite, the Azure AD client certificate must be previously deployed to the virtual machine's local computer my certificate store. The Add-AzureRmVMSecret cmdlet can be used to deploy a certificate to a virtual machine in Azure. For more details, see the Add-AzureRmVMSecret cmdlet help. The certificate must be previously deployed to the virtual machine local computer my certificate store. - - String - - - DiskEncryptionKeyVaultUrl - - Specifies the KeyVault URL to which the virtual machine encryption keys should be uploaded. - - String - - - DiskEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded. - - String - - - KeyEncryptionKeyUrl - - Specifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. - - String - - - KeyEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. - - String - - - KeyEncryptionAlgorithm - - Specifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP. - - String - - - VolumeType - - Specifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only. - - String - - - SequenceVersion - - Specifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used. - - String - - - TypeHandlerVersion - - Specifies the version of the encryption extension. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines. - - String - - - Passphrase - - Specifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine. - - String - - String - - - none - - - AadClientID - - Specifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault. - - String - - String - - - none - - - AadClientSecret - - Specifies the client secret of the Azure AD application that has permissions to write secrets to KeyVault. - - String - - String - - - none - - - DiskEncryptionKeyVaultUrl - - Specifies the KeyVault URL to which the virtual machine encryption keys should be uploaded. - - String - - String - - - none - - - DiskEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded. - - String - - String - - - none - - - KeyEncryptionKeyUrl - - Specifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. - - String - - String - - - none - - - KeyEncryptionKeyVaultId - - Specifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. - - String - - String - - - none - - - KeyEncryptionAlgorithm - - Specifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP. - - String - - String - - - none - - - VolumeType - - Specifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only. - - String - - String - - - none - - - SequenceVersion - - Specifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the encryption extension. - - String - - String - - - none - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines. - - String - - String - - - none - - - Passphrase - - Specifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - DisableAutoUpgradeMinorVersion - - - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - AadClientCertThumbprint - - Specifies the thumbprint of the AzureActive Directory (Azure AD) application client certificate that has permissions to write secrets to KeyVault. As a prerequisite, the Azure AD client certificate must be previously deployed to the virtual machine's local computer my certificate store. The Add-AzureRmVMSecret cmdlet can be used to deploy a certificate to a virtual machine in Azure. For more details, see the Add-AzureRmVMSecret cmdlet help. The certificate must be previously deployed to the virtual machine local computer my certificate store. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Enable encryption using Azure AD Client ID and Client Secret -------------------------- - - PS C:\> - - PS C:\>$RGName = "MyResourceGroup"; -PS C:\> $VMName = "MyTestVM"; -PS C:\> $AADClientID = "<clientID of your Azure AD app>"; -PS C:\> $AADClientSecret = "<clientSecret of your Azure AD app>"; -PS C:\> $VaultName= "MyKeyVault"; +New-AzureRmVM -ResourceGroupName $ResourceGroupName -Location $LocationName -VM $VirtualMachine -Verbose +This example takes an existing sys-prepped, generalized custom operating system image and attaches a data disk to it, provisions a new network, deploys the VHD, and runs it. This script can be used for automatic provisioning because it uses the local virtual machine admin credentials inline instead of calling Get-Credential which requires user interaction.This script assumes that you are already logged into your Azure account. You can confirm your login status by using the Get-AzureSubscription cmdlet.Get-AzureRmVMRemove-AzureRmVMRestart-AzureRmVMStart-AzureRmVMStop-AzureRmVMUpdate-AzureRmVMAdd-AzureRmVMDataDiskAdd-AzureRmVMNetworkInterfaceNew-AzureRmVMConfigSet-AzureRmVMOperatingSystemSet-AzureRmVMSourceImageSet-AzureRmVMOSDiskNew-AzureVMSqlServerAutoBackupConfigCreates a configuration object for SQL Server automatic backup.NewAzureVMSqlServerAutoBackupConfigThe New-AzureVMSqlServerAutoBackupConfig cmdlet creates a configuration object for SQL Server automatic backup. New-AzureVMSqlServerAutoBackupConfigResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringEnableIndicates that automated backup for the SQL Server virtual machine is enabled. If you specify this parameter, automated backup sets a backup schedule for all current and new databases. This updates your Managed Backup settings to follow this schedule.RetentionPeriodInDaysSpecifies the number of days to retain a backup.Int32EnableEncryptionIndicates that this cmdlet enables encryption.CertificatePasswordSpecifies a password to encrypt the certificate that is used to perform SQL Server encrypted backups.SecureStringStorageUriSpecifies the Uniform Resource Identifier (URI) of the blob storage account.UriStorageKeySpecifies the storage key of the blob storage account.SecureStringNew-AzureVMSqlServerAutoBackupConfigResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringEnableIndicates that automated backup for the SQL Server virtual machine is enabled. If you specify this parameter, automated backup sets a backup schedule for all current and new databases. This updates your Managed Backup settings to follow this schedule.RetentionPeriodInDaysSpecifies the number of days to retain a backup.Int32EnableEncryptionIndicates that this cmdlet enables encryption.CertificatePasswordSpecifies a password to encrypt the certificate that is used to perform SQL Server encrypted backups.SecureStringStorageUriSpecifies the Uniform Resource Identifier (URI) of the blob storage account.UriStorageContextSpecifies the storage account that will be used to store backups. To obtain an AzureStorageContext object, use the New-AzureStorageContext cmdlet. The default is the storage account that is associated with the SQL Server virtual machine.AzureStorageContextStorageKeySpecifies the storage key of the blob storage account.SecureStringCertificatePasswordSpecifies a password to encrypt the certificate that is used to perform SQL Server encrypted backups.SecureStringSecureStringnoneEnableIndicates that automated backup for the SQL Server virtual machine is enabled. If you specify this parameter, automated backup sets a backup schedule for all current and new databases. This updates your Managed Backup settings to follow this schedule.SwitchParameterSwitchParameternoneEnableEncryptionIndicates that this cmdlet enables encryption.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneRetentionPeriodInDaysSpecifies the number of days to retain a backup.Int32Int32noneStorageContextSpecifies the storage account that will be used to store backups. To obtain an AzureStorageContext object, use the New-AzureStorageContext cmdlet. The default is the storage account that is associated with the SQL Server virtual machine.AzureStorageContextAzureStorageContextnoneStorageKeySpecifies the storage key of the blob storage account.SecureStringSecureStringnoneStorageUriSpecifies the Uniform Resource Identifier (URI) of the blob storage account.UriUrinoneExample 1: Create an automatic backup configuration using storage URI and account keyPS C:\>$AutoBackupConfig = New-AzureVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri "\\contoso\StorageGeneral" -StorageKey "< Storage Key for ContosoGeneral >" +Enable : True +EnableEncryption : False +RetentionPeriodInDays : 10 +This command creates an automatic backup configuration object by specifying storage URI and account key. Automatic backup is enabled and automatic backups are kept for 10 days. The command stores the result in the $AutoBackupConfig variable. You can specify this configuration item for other cmdlets, such as the Set-AzureRmVMSqlServerExtension cmdlet.Example 2: Create an automatic backup configuration using storage contextPS C:\>$StorageContext = New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral >" +PS C:\> $AutoBackupConfig = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10 +Enable : True +EnableEncryption : False +RetentionPeriodInDays : 10 +The first command creates a storage context, and then stores it in the $StorageContext variable. For more information, see New-AzureStorageContext.The second command creates an automatic backup configuration object by specifying the storage context in $StorageContext. Automatic backup is enabled and automatic backups are kept for 10 days.Example 3: Create an automatic backup configuration using storage context with encryption and password PS C:\>$StorageContext = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10 -EnableEncryption -CertificatePassword $CertificatePassword +Enable : True +EnableEncryption : True +RetentionPeriodInDays : 10 +This command creates and stores an automatic backup configuration object. The command specifies the storage context created in a previous example. The command enables encryption with password. The password was previously stored as a secure string in the $CertificatePassword variable. To create a secure string, use the ConvertTo-SecureString cmdlet. New-AzureVMSqlServerAutoPatchingConfigSet-AzureRmVMSqlServerExtensionNew-AzureVMSqlServerAutoPatchingConfigCreates a configuration object for automatic patching on a virtual machine.NewAzureVMSqlServerAutoPatchingConfigThe New-AzureVMSqlServerAutoPatchingConfig cmdlet creates a configuration object for automatic patching on a virtual machine.New-AzureVMSqlServerAutoPatchingConfigDayOfWeekSpecifies the day of the week when updates should be installed.The acceptable values for this parameter are: + +-- Sunday +-- Monday +-- Tuesday +-- Wednesday +-- Thursday +-- Friday +-- Saturday +-- EverydaySundayMondayTuesdayWednesdayThursdayFridaySaturdayEverydayEnableIndicates that automated patching for the virtual machine is enabled. If you enable automated patching the cmdlet puts Windows Update into interactive mode. If you disable automated patching, Windows Update settings do not change.MaintenanceWindowDurationSpecifies the duration, in minutes, of the maintenance window. Automated patching avoids performing an action that can affect a virtual machine availability outside that window. Specify a multiple of 30 minutes.Int32MaintenanceWindowStartingHourSpecifies the hour of the day when maintenance window starts. This time defines when updates start to install. Int32PatchCategorySpecifies whether important updates should be included.StringDayOfWeekSpecifies the day of the week when updates should be installed.The acceptable values for this parameter are: + +-- Sunday +-- Monday +-- Tuesday +-- Wednesday +-- Thursday +-- Friday +-- Saturday +-- EverydayStringStringnoneEnableIndicates that automated patching for the virtual machine is enabled. If you enable automated patching the cmdlet puts Windows Update into interactive mode. If you disable automated patching, Windows Update settings do not change.SwitchParameterSwitchParameternoneMaintenanceWindowDurationSpecifies the duration, in minutes, of the maintenance window. Automated patching avoids performing an action that can affect a virtual machine availability outside that window. Specify a multiple of 30 minutes.Int32Int32noneMaintenanceWindowStartingHourSpecifies the hour of the day when maintenance window starts. This time defines when updates start to install. Int32Int32nonePatchCategorySpecifies whether important updates should be included.StringStringnoneAutoPatchingSettingsThis cmdlet returns object contains settings for automated patching.Example 1: Create a configuration object to configure automatic patchingPS C:\>$AutoPatchingConfig = New-AzureVMSqlServerAutoPatchingConfig -Enable -DayOfWeek "Thursday" -MaintenanceWindowStartingHour 11 -MaintenanceWindowDuration 120 -PatchCategory "Important" +Enable : True +DayOfWeek : Thursday +MaintenanceWindowStartingHour : 11 +MaintenanceWindowDuration : 120 +PatchCategory : Important +This command creates configuration object for patching. The command specifies the day of the week and defines the maintenance window. This configuration enables patching that uses these values. The command stores the result in the $AutoBackupConfig variable. You can specify this configuration item for other cmdlets, such as the Set-AzureRmVMSqlServerExtension cmdlet.New-AzureVMSqlServerAutoBackupConfigSet-AzureRmVMSqlServerExtensionNew-AzureVMSqlServerKeyVaultCredentialConfigNewAzureVMSqlServerKeyVaultCredentialConfigNew-AzureVMSqlServerKeyVaultCredentialConfigResourceGroupNameStringAzureKeyVaultUrlStringCredentialNameStringEnableServicePrincipalNameStringServicePrincipalSecretSecureStringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.AzureKeyVaultUrlStringStringnoneCredentialNameStringStringnoneEnableSwitchParameterSwitchParameternoneResourceGroupNameStringStringnoneServicePrincipalNameStringStringnoneServicePrincipalSecretSecureStringSecureStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalse 1: PS C:\> +Publish-AzureRmVMDscConfigurationUploads a DSC script to Azure blob storage.PublishAzureRmVMDscConfigurationThe Publish-AzureRmVMDscConfiguration cmdlet uploads a Desired State Configuration (DSC) script to Azure blob storage, which later can be applied to Azure virtual machines using the Set-AzureRmVMDscExtension cmdlet.Publish-AzureRmVMDscConfigurationConfigurationPathSpecifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file.StringResourceGroupNameSpecifies the name of the resource group that contains the storage account.StringStorageAccountNameSpecifies the Azure storage account name that is used to upload the configuration script to the container specified by the ContainerName parameter.StringContainerNameSpecifies the name of the Azure storage container the configuration is uploaded to. StringAdditionalPathSpecifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration.String[]ConfigurationDataPathSpecifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdletStringForceForces the command to run without asking for user confirmation.SkipDependencyDetectionIndicates that this cmdlet excludes DSC resource dependencies from the configuration archive.StorageEndpointSuffixSpecifies the suffix for the storage end point.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Publish-AzureRmVMDscConfigurationConfigurationPathSpecifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file.StringOutputArchivePathSpecifies the path of a local .zip file to write the configuration archive to. When this parameter is used, the configuration script is not uploaded to Azure blob storage.StringAdditionalPathSpecifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration.String[]ConfigurationDataPathSpecifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdletStringForceForces the command to run without asking for user confirmation.SkipDependencyDetectionIndicates that this cmdlet excludes DSC resource dependencies from the configuration archive.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.AdditionalPathSpecifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with the configuration.String[]String[]noneConfigurationDataPathSpecifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdletStringStringnoneConfigurationPathSpecifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows PowerShell module (.psm1) file.StringStringnoneContainerNameSpecifies the name of the Azure storage container the configuration is uploaded to. StringStringnoneForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneOutputArchivePathSpecifies the path of a local .zip file to write the configuration archive to. When this parameter is used, the configuration script is not uploaded to Azure blob storage.StringStringnoneResourceGroupNameSpecifies the name of the resource group that contains the storage account.StringStringnoneSkipDependencyDetectionIndicates that this cmdlet excludes DSC resource dependencies from the configuration archive.SwitchParameterSwitchParameternoneStorageAccountNameSpecifies the Azure storage account name that is used to upload the configuration script to the container specified by the ContainerName parameter.StringStringnoneStorageEndpointSuffixSpecifies the suffix for the storage end point.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Create a .zip package an upload it to Azure storagePS C:\>Publish-AzureRmVMDscConfiguration ".\MyConfiguration.ps1" +This command creates a .zip package for the given script and any dependent resource modules and uploads it to Azure storage.Example 2: Create a .zip package and store it to a local filePS C:\>Publish-AzureRmVMDscConfiguration ".\MyConfiguration.ps1" -OutputArchivePath ".\MyConfiguration.ps1.zip" +This command creates a .zip package for the given script and any dependent resource modules and stores it in the local file that is named .\MyConfiguration.ps1.zip.Example 3: Add configuration to the archive and then upload it to storagePS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -SkipDependencyDetection +This command adds configuration named Sample.ps1 to the configuration archive to upload to Azure storage and skips dependent resource modules.Example 4: Add configuration and configuration data to the archive and then upload it to storagePS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -ConfigurationDataPath "C:\SampleData.psd1" +This command adds configuration named Sample.ps1 and configuration data named SampleData.psd1 to the configuration archive to upload to Azure storage.Example 5: Add configuration, configuration data, and additional content to the archive and then upload it to storagePS C:\>Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\Sample.ps1" -AdditionalPath @("C:\ContentDir1", "C:\File.txt") -ConfigurationDataPath "C:\SampleData.psd1" +This command adds configuration named Sample.ps1, configuration data SampleData.psd1, and additional content to configuration archive to upload to Azure storage.Get-AzureRmVMDscExtensionRemove-AzureRmVMDscExtensionSet-AzureRmVMDscExtensionRemove-AzureRmAvailabilitySetRemoves an availability set from Azure.RemoveAzureRmAvailabilitySetThe Remove-AzureRmAvailabilitySet cmdlet removes an availability set from Azure.Remove-AzureRmAvailabilitySetResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the availability set to remove.StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifies the name of the availability set to remove.StringStringnoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove an availability setPS C:\>Remove-AzureRmAvailabilitySet -Name "AvailabilitySet03" -ResourceGroupName "ResourceGroup11" +This command removes an availability set named AvailablitySet03 in the resource group named ResourceGroup11. Get-AzureRmAvailabilitySetNew-AzureRmAvailabilitySetRemove-AzureRmContainerServiceAgentPoolProfileRemoves an agent pool profile from a container service. RemoveAzureRmContainerServiceAgentPoolProfileThe Remove-AzureRmContainerServiceAgentPoolProfile cmdlet removes an agent pool profile from a container service.Remove-AzureRmContainerServiceAgentPoolProfileContainerServiceSpecifies the container service object from which this cmdlet removes an agent pool profile. ContainerServiceNameSpecifies the name of the agent pool profile that this cmdlet removes. StringContainerServiceSpecifies the container service object from which this cmdlet removes an agent pool profile. ContainerServiceContainerServicenoneNameSpecifies the name of the agent pool profile that this cmdlet removes. StringStringnoneExample 1: Remove a profile from a container servicePS C:\>$Container = Get-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" +PS C:\> Remove-AzureRmContainerServiceAgentPoolProfile -ContainerService $Container -Name "AgentPool01" +The first command gets a container service named CSResourceGroup17 by using the Get-AzureRmContainerService cmdlet. The command stores the service in the $Container variable. The second command removes the profile named AgentPool01 from the container service in $Container. Add-AzureRmContainerServiceAgentPoolProfileGet-AzureRmContainerServiceRemove-AzureRmContainerServiceRemoves a container service. RemoveAzureRmContainerServiceThe Remove-AzureRmContainerService cmdlet removes a container service from your Azure account. Remove-AzureRmContainerServiceResourceGroupNameSpecifies the resource group of the container service that this cmdlet removes. StringNameSpecifies the name of the container service that this cmdlet removes. StringNameSpecifies the name of the container service that this cmdlet removes. StringStringnoneResourceGroupNameSpecifies the resource group of the container service that this cmdlet removes. StringStringnoneExample 1: Remove a container servicePS C:\>Remove-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" +This command removes the container service named CSResourceGroup17.Get-AzureRmContainerServiceNew-AzureRmContainerServiceUpdate-AzureRmContainerServiceRemove-AzureRmVMAccessExtensionRemoves the VMAccess extension from a virtual machine.RemoveAzureRmVMAccessExtensionThe Remove-AzureRmVMAccessExtension cmdlet removes the Virtual Machine Access (VMAccess) Virtual Machine Extension from a virtual machine.Remove-AzureRmVMAccessExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet removes VMAccess for the virtual machine that this parameter specifies.StringNameSpecifies the name of the extension that this cmdlet removes.StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifies the name of the extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet removes VMAccess for the virtual machine that this parameter specifies.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalse 1: Get-AzureRmVMAccessExtensionSet-AzureRmVMAccessExtensionRemove-AzureRmVMExtensionRemove-AzureRmVMAEMExtensionRemoves the AEM extension from a virtual machine.RemoveAzureRmVMAEMExtensionThe Remove-AzureRmVMAEMExtension cmdlet removes the Azure Enhanced Monitoring (AEM) extension from a virtual machine.Remove-AzureRmVMAEMExtensionResourceGroupNameSpecifies the name of the resource group of a virtual machine. This cmdlet removes the AEM extension from that virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet removes the AEM extension for the virtual machine that this parameter specifies.StringNameSpecifies the name of the virtual machine from which this cmdlet removes the AEM extension. StringOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. StringNameSpecifies the name of the virtual machine from which this cmdlet removes the AEM extension. StringStringnoneOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. StringStringnoneResourceGroupNameSpecifies the name of the resource group of a virtual machine. This cmdlet removes the AEM extension from that virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet removes the AEM extension for the virtual machine that this parameter specifies.StringStringnoneExample 1: Remove the AEM extensionPS C:\>Remove-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" +This command removes the AEM extension for the virtual machine named contoso-server.Get-AzureRmVMAEMExtensionSet-AzureRmVMAEMExtensionTest-AzureRmVMAEMExtensionRemove-AzureRmVMBackupRemoveAzureRmVMBackupRemove-AzureRmVMBackupResourceGroupNameStringVMNameStringTagStringResourceGroupNameStringStringnoneTagStringStringnoneVMNameStringStringnone 1: PS C:\> +Remove-AzureRmVMChefExtensionRemoves the Chef extension from a virtual machine.RemoveAzureRmVMChefExtensionThe Remove-AzureVMChefExtension cmdlet removes the Chef extension from a virtual machine.Remove-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringVMNameSpecifies the name of a virtual machine for which this cmdlet removes the Chef extension.StringNameSpecifies the name of the Chef extension that this cmdlet removes.StringLinuxIndicates that this cmdlet targets a Linux virtual machine.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Remove-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringVMNameSpecifies the name of a virtual machine for which this cmdlet removes the Chef extension.StringNameSpecifies the name of the Chef extension that this cmdlet removes.StringWindowsIndicates that this cmdlet targets a Windows virtual machine.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.LinuxIndicates that this cmdlet targets a Linux virtual machine.SwitchParameterSwitchParameternoneNameSpecifies the name of the Chef extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine for which this cmdlet removes the Chef extension.StringStringnoneWindowsIndicates that this cmdlet targets a Windows virtual machine.SwitchParameterSwitchParameternoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove a Chef extension from a Windows virtual machinePS C:\>Remove-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup001" -VMName "WindowsVM001" -Windows +This command removes a Chef extension from a Windows based virtual machine named WindowsVM001 that belongs to the resource group named ResourceGroup001.Example 2: Remove a Chef extension from a Linux virtual machinePS C:\>Remove-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup002" -VMName "LinuxVM001" -Linux +This command removes a Chef extension from a Linux based virtual machine named LinuxVM001 that belongs to the resource group named ResourceGroup002.Get-AzureRmVMChefExtensionSet-AzureRmVMChefExtensionRemove-AzureRmVMCustomScriptExtensionRemoves a custom script extension from a virtual machine. RemoveAzureRmVMCustomScriptExtensionThe Remove-AzureRmVMCustomScriptExtension cmdlet removes a custom script Virtual Machine Extension from a virtual machine.Remove-AzureRmVMCustomScriptExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine from which this cmdlet removes the custom script extension.StringNameSpecifies the name of the custom script extension that this cmdlet removes.StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifies the name of the custom script extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine from which this cmdlet removes the custom script extension.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalse 1: Get-AzureRmVMCustomScriptExtensionSet-AzureRmVMCustomScriptExtensionRemove-AzureRmVMDataDiskRemoves a data disk from a virtual machine.RemoveAzureRmVMDataDiskThe Remove-AzureRmVMDataDisk cmdlet removes a data disk from a virtual machine.Remove-AzureRmVMDataDiskVMSpecifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineDataDiskNamesSpecifies the names of one or more data disks that this cmdlet removes.String[]DataDiskNamesSpecifies the names of one or more data disks that this cmdlet removes.String[]String[]noneVMSpecifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachinePSVirtualMachinenoneExample 1: Remove a data disk from a virtual machinePS C:\>$VirtualMachine = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Remove-AzureRmVMDataDisk -VM $VirtualMachine -Name "Disk3" +PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine +The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureRmVM cmdlet. The command stores the virtual machine in the $VirtualMachine variable. The second command removes the data disk named Disk3 from the virtual machine stored in $VirtualMachine. The final command updates the state of the virtual machine stored in $VirtualMachine in ResourceGroup11.Add-AzureRmVMDataDiskGet-AzureRmVMRemove-AzureRmVMDiagnosticsExtensionRemoves the Diagnostics extension from a virtual machine.RemoveAzureRmVMDiagnosticsExtensionThe Remove-AzureRmVMDiagnosticsExtension cmdlet removes an Azure Diagnostics extension from a virtual machine. You must pass the output of this cmdlet to the Update-AzureRmVM cmdlet to implement your changes.Remove-AzureRmVMDiagnosticsExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine from which this cmdlet removes a Diagnostics extension. StringNameSpecifies the name of the Diagnostics extension that this cmdlet removes.StringNameSpecifies the name of the Diagnostics extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine from which this cmdlet removes a Diagnostics extension. StringStringnoneExample 1: Remove the Diagnostics extension from a virtual machinePS C:\>Remove-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM22" | Update-AzureRmVM +This command removes the Diagnostics extension from a virtual machine named ContosoVM22. The command passes the result to the Update-AzureRmVM cmdlet by using the pipeline operator. That command updates the virtual machine.Get-AzureRmVMDiagnosticsExtensionSet-AzureRmVMDiagnosticsExtensionUpdate-AzureRmVMRemove-AzureRmVMDiskEncryptionExtensionRemoves the disk encryption extension from a virtual machine.RemoveAzureRmVMDiskEncryptionExtensionThe Remove-AzureRmVMDiskEncryptionExtension cmdlet removes the disk encryption extension from a virtual machine. If no extension name is specified, this cmdlet removes the extension with default name AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux based virtual machines. This cmdlet does not disable encryption on the virtual machine. It removes the extension and the associated extension configuration from the virtual machine.Remove-AzureRmVMDiskEncryptionExtensionResourceGroupNameSpecifies the name of the resource group for the virtual machine.StringVMNameSpecifies the name of the virtual machine.StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDiskEncryptionExtension cmdlet sets this name to AzureDiskEncryption for virtual machines that run the Windows operating system and AzureDiskEncryptionForLinux for Linux virtual machines. Specify this parameter only if you changed the default name in the Set-AzureRmVMDiskEncryptionExtension cmdlet or used a different resource name in a Resource Manager template.StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The Set-AzureRmVMDiskEncryptionExtension cmdlet sets this name to AzureDiskEncryption for virtual machines that run the Windows operating system and AzureDiskEncryptionForLinux for Linux virtual machines. Specify this parameter only if you changed the default name in the Set-AzureRmVMDiskEncryptionExtension cmdlet or used a different resource name in a Resource Manager template.StringStringnoneResourceGroupNameSpecifies the name of the resource group for the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove the disk encryption extension from a virtual machine.PS C:\>Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName "MyResourceGroup" -VMName "MyTestVM" +This command removes the extension with default name AzureDiskEncryption for a virtual machine that runs the Windows operating system or AzureDiskEncryptionForLinux for Linux based virtual machine named MyTestVM. Example 2: Remove a specific disk encryption extension from a virtual machine.PS C:\>Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName "MyResourceGroup" -VMName "MyTestVM" -Name "MyDiskEncryptionExtension" +This command removes the encryption extension named MyDiskEncryptionExtension from the virtual machine named MyTestVM.Get-AzureRmVMDiskEncryptionStatusSet-AzureRmVMDiskEncryptionExtensionRemove-AzureRmVMDscExtensionRemoves a DSC extension handler from a virtual machine in a resource group.RemoveAzureRmVMDscExtensionThe Remove-AzureRmVMDscExtension cmdlet removes a Desired State Configuration (DSC) extension handler from a virtual machine in a resource group.Remove-AzureRmVMDscExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine from which this cmdlet removes the DSC extension.StringNameSpecifies the name of the DSC extension that this cmdlet removes. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the default value used by Remove-AzureRmVMDscExtension.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.NameSpecifies the name of the DSC extension that this cmdlet removes. The Set-AzureRmVMDscExtension cmdlet sets this name to Microsoft.Powershell.DSC, which is the default value used by Remove-AzureRmVMDscExtension.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine from which this cmdlet removes the DSC extension.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove a DSC extensionPS C:\>Remove-AzureRmVMDscExtension -ResouceGroupName "ResourceGroup001" -VMName "VM07" -Name "DSC" +This command removes the extension named DSC on virtual machine named VM07. Get-AzureRmVMDscExtensionSet-AzureRmVMDscExtensionRemove-AzureRmVMExtensionRemoves an extension from a virtual machine.RemoveAzureRmVMExtensionThe Remove-AzureRmVMExtension cmdlet removes an extension from the Virtual Machine Extensions of a virtual machine.Remove-AzureRmVMExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine from which this cmdlet removes the extension.StringNameSpecifies the name of the extension that this cmdlet removes.StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneNameSpecifies the name of the extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine from which this cmdlet removes the extension.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove an extension from a virtual machinePS C:\>Remove-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Name "ContosoTest" -VMName "VirtualMachine22" +This command removes the extension named ContosoTest from the virtual machine named VirtualMachine22 in ResourceGroup11.Get-AzureRmVMExtensionSet-AzureRmVMExtensionRemove-AzureRmVMNetworkInterfaceRemoves a network interface from a virtual machine.RemoveAzureRmVMNetworkInterfaceThe Remove-AzureRmVMNetworkInterface cmdlet removes a network interface from a virtual machine. Remove-AzureRmVMNetworkInterfaceVMSpecifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineNetworkInterfaceIDsSpecifies an array of network interface IDs that this cmdlet removes.String[]NetworkInterfaceIDsSpecifies an array of network interface IDs that this cmdlet removes.String[]String[]noneVMSpecifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachinePSVirtualMachinenone 1: Get-AzureRmVMRemove-AzureRMVMSqlServerExtensionRemoves a SQL Server extension from a virtual machine. RemoveAzureRMVMSqlServerExtensionThe Remove-AzureRmVMSqlServerExtension cmdlet removes an AzureSQL Server extension from a virtual machine.Remove-AzureRMVMSqlServerExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine from which this cmdlet removes the SQL Server extension.StringNameSpecifies the name of the SQL Server the extension that this cmdlet removes.StringNameSpecifies the name of the SQL Server the extension that this cmdlet removes.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine from which this cmdlet removes the SQL Server extension.StringStringnoneExample 1: Remove a SQL Server extensionPS C:\>Remove-AzureRMVMSqlServerExtension -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM22" -Name "SqlIaaSAgent" +This command removes a SQL Server extension from the virtual machine named ContosoVM22. Get-AzureRmVMSqlServerExtensionSet-AzureRmVMSqlServerExtensionRemove-AzureRmVmssExtensionRemoves an extension from the VMSS.RemoveAzureRmVmssExtensionThe Remove-AzureRmVmssExtension cmdlet removes an extension from the Virtual Machine Scale Set (VMSS).Remove-AzureRmVmssExtensionVirtualMachineScaleSetSpecifies the VMSS from which to remove the extension from.VirtualMachineScaleSetNameSpecifies the name of the extension that this cmdlet removes from the VMSS.StringNameSpecifies the name of the extension that this cmdlet removes from the VMSS.StringStringnoneVirtualMachineScaleSetSpecifies the VMSS from which to remove the extension from.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output. 1: Add-AzureRmVmssExtensionRemove-AzureRmVmssNetworkInterfaceConfigurationRemoves a network interface configuration from a VMSS.RemoveAzureRmVmssNetworkInterfaceConfigurationThe Remove-AzureRmVmssNetworkInterfaceConfiguration cmdlet removes a network interface configuration from a Virtual Machine Scale Set (VMSS).Remove-AzureRmVmssNetworkInterfaceConfigurationVirtualMachineScaleSetSpecifies the VMSS object. VirtualMachineScaleSetNameSpecifies the name of the network interface configuration that this cmdlet removes.StringNameSpecifies the name of the network interface configuration that this cmdlet removes.StringStringnoneVirtualMachineScaleSetSpecifies the VMSS object. VirtualMachineScaleSetVirtualMachineScaleSetnoneExample 1: Remove an interface configurationPS C:\>$VMSS = Get-AzureRmVmss -ResourceGroupName "ResourceGroup11" -VMScaleSetName "ContosoVMSS14" +PS C:\> Remove-AzureRmVmssNetworkInterfaceConfiguration -VirtualMachineScaleSet $VMSS -Name "ContosoVmssInterface02" +The first command gets a VMSS by using the Get-AzureRmVmss cmdlet, and then stores it in the $VMSS variable. The second command removes the network interface configuration named ContosoVmssInterface02 from the set in $VMSS.Add-AzureRmVmssNetworkInterfaceConfigurationGet-AzureRmVmssRemove-AzureRmVmssRemoves the VMSS or a virtual machine that is within the VMSS.RemoveAzureRmVmssThe Remove-AzureRmVmss cmdlet removes the Virtual Machine Scale Set (VMSS) from Azure. This cmdlet can also be used to remove a specific virtual machine inside the VMSS. You can use the InstanceId parameter to remove a specific virtual machine inside the VMSS.Remove-AzureRmVmssResourceGroupNameSpecifies the name of the resource group that the VMSS belongs to.StringVMScaleSetNameSpecies the name of the VMSS that this cmdlet removes. If you specify the InstanceId parameter, the cmdlet will remove the specified virtual machine from the VMSS named by this parameter.StringInstanceIdSpecifies, as a string array, the ID of the instances that need to be started. For instance: -InstanceId "0", "3"String[]InstanceIdSpecifies, as a string array, the ID of the instances that need to be started. For instance: -InstanceId "0", "3"String[]String[]noneResourceGroupNameSpecifies the name of the resource group that the VMSS belongs to.StringStringnoneVMScaleSetNameSpecies the name of the VMSS that this cmdlet removes. If you specify the InstanceId parameter, the cmdlet will remove the specified virtual machine from the VMSS named by this parameter.StringStringnoneExample 1: Remove a VMSSPS C:\>Remove-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMScaleSet001" +This command removes the VMSS named VMScaleSet001 that belongs to the resource group named Group001.Example 2: Remove a virtual machine from within a VMSSPS C:\>Remove-AzureRmVmss -ResourceGroupName "Group002" -VMScaleSetName "VMScaleSet002" -InstanceId "3"; +This command removes the virtual machine with instance ID 3 from the VMSS named VMScaleSet002 that belongs to the resource group named Group002.Get-AzureRmVmssNew-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssRemove-AzureRmVMRemoves a virtual machine from Azure.RemoveAzureRmVMThe Remove-AzureRmVM cmdlet removes a virtual machine from Azure.Remove-AzureRmVMResourceGroupNameSpecifies the name of a resource group.StringNameSpecifies the name of the virtual machine to remove. StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Remove-AzureRmVMIdSpecifies the Resource ID of the virtual machine.StringNameSpecifies the name of the virtual machine to remove. StringForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneIdSpecifies the Resource ID of the virtual machine.StringStringnoneNameSpecifies the name of the virtual machine to remove. StringStringnoneResourceGroupNameSpecifies the name of a resource group.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Remove a virtual machinePS C:\>Remove-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +This command removes the virtual machine named VirtualMachine07 in the resource group ResourceGroup11.Get-AzureRmVMNew-AzureRmVMRestart-AzureRmVMStart-AzureRmVMStop-AzureRmVMUpdate-AzureRmVMRestart-AzureRmVmssRestarts the VMSS or a virtual machine within the VMSS.RestartAzureRmVmssThe Restart-AzureRmVmss cmdlet restarts the Virtual Machine Scale Set (VMSS). This cmdlet can also be used to restart a specific virtual machine inside the VMSS by using the InstanceId parameter.Restart-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS that this cmdlet restarts.StringInstanceIdSpecifies, as a string array, the ID of the instances that need restarted.String[]InstanceIdSpecifies, as a string array, the ID of the instances that need restarted.String[]String[]noneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVMScaleSetNameSpecies the name of the VMSS that this cmdlet restarts.StringStringnoneThis cmdlet does not generate any output.Example 1: Restart the VMSSPS C:\>Restart-AzureRmVmss -ResourceGroupName "Group001" -VMScaleSetName "VMSS001"; +This command restarts the VMSS named VMSS001 that belongs to the resource group named Group001.Example 2: Restart a specific virtual machine within the VMSSPS C:\>Restart-AzureRmVmss -ResourceGroupName "Group004" -VMScaleSetName "VMSS001" -InstanceId "1" +This command restarts a virtual machine that has the instance ID of 1 in the VMSS named VMSS001 that belongs to the resource group named Group001.Get-AzureRmVmssNew-AzureRmVmssRemove-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssRestart-AzureRmVMRestarts an Azure virtual machine. RestartAzureRmVMThe Restart-AzureRmVM cmdlet restarts an Azure virtual machine.Restart-AzureRmVMIdSpecifies an ID.StringNameSpecifies the name of the virtual machine to restart.StringRestart-AzureRmVMResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine to restart.StringIdSpecifies an ID.StringStringnoneNameSpecifies the name of the virtual machine to restart.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneExample 1: Restart a virtual machinePS C:\>Restart-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +This command restarts the virtual machine named VirtualMachine07 in ResourceGroup11.Get-AzureRmVMNew-AzureRmVMRemove-AzureRmVMStart-AzureRmVMStop-AzureRmVMUpdate-AzureRmVMSave-AzureRmVhdSaves downloaded .vhd images locally.SaveAzureRmVhdThe Save-AzureRmVhd cmdlet saves .vhd images from a blob where they are stored to a file. You can specify the number of downloader threads that the process uses and whether to replace a file that already exists.This cmdlet downloads content as it is. It does not apply any Virtual Hard Disk (VHD) format conversion. Save-AzureRmVhdResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringSourceUriSpecifies the Uniform Resource Identifier (URI) of the blob in azure_2.UriLocalFilePathSpecifies the local file path of the saved image.FileInfoNumberOfThreadsSpecifies the number of download threads that this cmdlet uses during download.Int32OverWriteIndicates that this cmdlet replaces the file specified by LocalFilePath file if it exists.Save-AzureRmVhdStorageKeySpecifies the storage key of the blob storage account. If you do not specify a key, this cmdlet attempts to determine the storage key of the account in SourceUri from Azure.StringSourceUriSpecifies the Uniform Resource Identifier (URI) of the blob in azure_2.UriLocalFilePathSpecifies the local file path of the saved image.FileInfoNumberOfThreadsSpecifies the number of download threads that this cmdlet uses during download.Int32OverWriteIndicates that this cmdlet replaces the file specified by LocalFilePath file if it exists.LocalFilePathSpecifies the local file path of the saved image.FileInfoFileInfononeNumberOfThreadsSpecifies the number of download threads that this cmdlet uses during download.Int32Int32noneOverWriteIndicates that this cmdlet replaces the file specified by LocalFilePath file if it exists.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneSourceUriSpecifies the Uniform Resource Identifier (URI) of the blob in azure_2.UriUrinoneStorageKeySpecifies the storage key of the blob storage account. If you do not specify a key, this cmdlet attempts to determine the storage key of the account in SourceUri from Azure.StringStringnoneExample 1: Download an imagePS C:\>Save-AzureRmVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" +This command downloads a .vhd file, and stores it in the local path C:\vhd\Win7Image.vhd.Example 2: Download an image and overwrite the local filePS C:\>Save-AzureRmVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -Overwrite +This command downloads a .vhd file, and stores it in the local path. The command includes the Overwrite parameter. Therefore, if C:\vhd\Win7Image.vhd already exists, this command replaces it.Example 3: Download an image by using a specified number of threadsPS C:\>Save-AzureRmVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32 +This command downloads a .vhd file, and stores it in the local path. The command specifies a value of 32 for the NumberOfThreads parameter. Therefore, the cmdlet uses 32 threads for this action.Example 4: Download an image and specify the storage keyPS C:\>Save-AzureRmVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -StorageKey "zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw==" +This command downloads a .vhd file and specifies the storage key.Add-AzureRmVhdSave-AzureRmVMImageSaves a virtual machine as a VMImage.SaveAzureRmVMImageThe Save-AzureRmVMImage cmdlet saves a virtual machine as a VMImage. Before you create a virtual machine image, sysprep the virtual machine, and then mark it as generalized by using the Set-AzureRmVM cmdlet.The output of this cmdlet is a JavaScript Object Notation (JSON) template. You can deploy virtual machines from your captured image.Save-AzureRmVMImageResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies a name.StringDestinationContainerNameSpecifies the name of a container inside the "system" container that you want to hold your images. If the container doesn't exist, it is created for you. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. The URL of the saved image is similar to: + +https://<storageAccountName>.blob.core.windows.net/system/Microsoft.Compute/Images/<imagesContainer>/<vhdPrefix-osDisk>.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.vhd.StringVHDNamePrefixSpecifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for an operating system disk results in the name vhdPrefix-osdisk.<guid>.vhd.StringOverwriteIndicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. PathSpecifies the path of the VHD.StringSave-AzureRmVMImageIdSpecifies the Resource ID of the virtual machine.StringNameSpecifies a name.StringDestinationContainerNameSpecifies the name of a container inside the "system" container that you want to hold your images. If the container doesn't exist, it is created for you. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. The URL of the saved image is similar to: + +https://<storageAccountName>.blob.core.windows.net/system/Microsoft.Compute/Images/<imagesContainer>/<vhdPrefix-osDisk>.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.vhd.StringVHDNamePrefixSpecifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for an operating system disk results in the name vhdPrefix-osdisk.<guid>.vhd.StringOverwriteIndicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. PathSpecifies the path of the VHD.StringDestinationContainerNameSpecifies the name of a container inside the "system" container that you want to hold your images. If the container doesn't exist, it is created for you. The virtual hard disks (VHDs) that constitute the VMImage reside in the container that this parameter specifies. If the VHDs are spread across multiple storage accounts, this cmdlet creates one container that has this name in each storage account. The URL of the saved image is similar to: + +https://<storageAccountName>.blob.core.windows.net/system/Microsoft.Compute/Images/<imagesContainer>/<vhdPrefix-osDisk>.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.vhd.StringStringnoneIdSpecifies the Resource ID of the virtual machine.StringStringnoneNameSpecifies a name.StringStringnoneOverwriteIndicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. SwitchParameterSwitchParameternonePathSpecifies the path of the VHD.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVHDNamePrefixSpecifies the prefix in the name of the blobs that constitute the storage profile of the VMImage. For example, a prefix vhdPrefix for an operating system disk results in the name vhdPrefix-osdisk.<guid>.vhd.StringStringnoneExample 1: Capture a virtual machinePS C:\>Set-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized +PS C:\> Save-AzureRmVMImage -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -DestinationContainerName "VMContainer01" -VHDNamePrefix "VM07" +The first command marks the virtual machine named VirtualMachine07 as generalized. The second command captures a virtual machine named VirtualMachine07 as a VMImage. The Output property returns a JSON template.Get-AzureRmVMImageGet-AzureRmVMImageOfferGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuSet-AzureRmVMSet-AzureRmVMAccessExtensionAdds the VMAccess extension to a virtual machine.SetAzureRmVMAccessExtensionThe Set-AzureRmVMAccessExtension cmdlet adds the Virtual Machine Access (VMAccess) Virtual Machine Extension to a virtual machine. VMAccess can reset the virtual machine user name and password.Set-AzureRmVMAccessExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies.StringDisableAutoUpgradeMinorVersionForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the extension that this cmdlet adds.StringPasswordSpecifies the new password of the virtual machine.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. StringUserNameSpecifies the new user name for the virtual machine.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.DisableAutoUpgradeMinorVersionSwitchParameterSwitchParameternoneForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringStringnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the extension that this cmdlet adds.StringStringnonePasswordSpecifies the new password of the virtual machine.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. StringStringnoneUserNameSpecifies the new user name for the virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet adds VMAccess for the virtual machine that this parameter specifies.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Add a VMAccess extensionPS C:\>Set-AzureRmVMAccessExtension -ResourceGroupName "ResrouceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "2.0" -UserName "PFuller" -Password "Password" +This command adds a VMAccess extension for the virtual machine named VirtualMachine07 in ResrouceGroup11. The command specifies the name and type handler version for VMAccess.Get-AzureRmVMAccessExtensionRemove-AzureRmVMAccessExtensionSet-AzureRmVMExtensionGet-AzureRmVMExtensionImageSet-AzureRmVMADDomainExtensionAdds an AD domain extension to a virtual machine.SetAzureRmVMADDomainExtensionThe Set-AzureRmVMADDomainExtension cmdlet adds an Azure Active Directory (AD) domain virtual machine extension to a virtual machine. This extension lets your virtual machine join a domain.Set-AzureRmVMADDomainExtensionResourceGroupNameSpecifies the name of the resource group.StringVMNameSpecifies the name of the virtual machine.StringCredentialSpecifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.PSCredentialDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.ForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringJoinOptionSpecifies the join option.UInt32]LocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the domain extension to add.StringOUPathSpecifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU in quotation marks. The default value is the default OU for machine objects in the domain.StringRestartIndicates that this cmdlet restarts the virtual machine. A restart is often required to make the change effective.TypeHandlerVersionSpecifies the version of the domain extension.StringDomainNameSpecifies the name of the domain.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.CredentialSpecifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.PSCredentialPSCredentialnoneDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.SwitchParameterSwitchParameternoneDomainNameSpecifies the name of the domain.StringStringnoneForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringStringnoneJoinOptionSpecifies the join option.UInt32]UInt32]noneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the domain extension to add.StringStringnoneOUPathSpecifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU in quotation marks. The default value is the default OU for machine objects in the domain.StringStringnoneResourceGroupNameSpecifies the name of the resource group.StringStringnoneRestartIndicates that this cmdlet restarts the virtual machine. A restart is often required to make the change effective.SwitchParameterSwitchParameternoneTypeHandlerVersionSpecifies the version of the domain extension.StringStringnoneVMNameSpecifies the name of the virtual machine.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalse 1: Get-AzureRmVMADDomainExtensionSet-AzureRmVMAEMExtensionEnables support for monitoring for SAP systems.SetAzureRmVMAEMExtensionThe Set-AzureRmVMAEMExtension cmdlet updates the configuration of a virtual machine to enable or update the support for monitoring for SAP systems that are installed on the virtual machine. The cmdlet installs the Azure Enhanced Monitoring (AEM) extension that collects the performance data and makes it discoverable for the SAP system.Set-AzureRmVMAEMExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine that this cmdlet modifies.StringVMNameSpecifies the name of a virtual machine. This cmdlet adds the AEM extension for the virtual machine that this parameter specifies.StringDisableWADIndicates that this cmdlet does not enable Azure Diagnostics for the virtual machine.WADStorageAccountNameSpecifies the name of the storage account that this cmdlet uses to configure the LinuxDiagnostics or IaaSDiagnostics extension. If the virtual machine does not use a standard storage account, you must specify a value for this parameter.StringOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux.StringSkipStorageIndicates that this cmdlet skips configuration of storage. DisableWADIndicates that this cmdlet does not enable Azure Diagnostics for the virtual machine.SwitchParameterSwitchParameternoneOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine that this cmdlet modifies.StringStringnoneSkipStorageIndicates that this cmdlet skips configuration of storage. SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine. This cmdlet adds the AEM extension for the virtual machine that this parameter specifies.StringStringnoneWADStorageAccountNameSpecifies the name of the storage account that this cmdlet uses to configure the LinuxDiagnostics or IaaSDiagnostics extension. If the virtual machine does not use a standard storage account, you must specify a value for this parameter.StringStringnoneExample 1: Use AEM extensionPS C:\>Set-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" -WADStorageAccountName "stdstorage" +This command configures the virtual machine named contoso-server to use the AEM extension. The command specifies the storage account named stdstorage. Get-AzureRmVMAEMExtensionRemove-AzureRmVMAEMExtensionTest-AzureRmVMAEMExtensionSet-AzureRmVMBackupExtensionSetAzureRmVMBackupExtensionSet-AzureRmVMBackupExtensionResourceGroupNameStringVMNameStringNameStringTagStringNameStringStringnoneResourceGroupNameStringStringnoneTagStringStringnoneVMNameStringStringnone 1: PS C:\> +Set-AzureRmVMBginfoExtensionAdds the BGInfo extension to a virtual machine.SetAzureRmVMBginfoExtensionThe Set-AzureRmVMBGInfoExtension cmdlet adds the BGInfo extension to a virtual machine.Set-AzureRmVMBginfoExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine to which this cmdlet adds an extension.StringVMNameSpecifies the name of the virtual machine to which this cmdlet adds the BGInfo extension.StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet prevents the Azure guest agent from automatically updating the extension to a newer minor version. By default, this cmdlet enables the guest agent to update the extension. ForceRerunSpecifies that the extension should be run again with the same public or protected settings. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the BGInfo extension that this cmdlet adds to a virtual machine.StringTypeHandlerVersionSpecifies the version of the extension that this cmdlet adds to the virtual machine.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.DisableAutoUpgradeMinorVersionIndicates that this cmdlet prevents the Azure guest agent from automatically updating the extension to a newer minor version. By default, this cmdlet enables the guest agent to update the extension. SwitchParameterSwitchParameternoneForceRerunSpecifies that the extension should be run again with the same public or protected settings. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringStringnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the BGInfo extension that this cmdlet adds to a virtual machine.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine to which this cmdlet adds an extension.StringStringnoneTypeHandlerVersionSpecifies the version of the extension that this cmdlet adds to the virtual machine.StringStringnoneVMNameSpecifies the name of the virtual machine to which this cmdlet adds the BGInfo extension.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Add the BGInfo extension for a virtual machinePS C:\>Set-AzureVMBGInfoExtension -ResrouceGroupName "ContosoRG" -VMName "ContosoVM" -Name "ExtensionName" -TypeHandlerVersion "2.1" -Location "West Europe" +This command adds the BGInfo extension to virtual machine named ContosoVM. The command specifies the resource group and location of the virtual machine. The command specifies the name and version of the extension.Set-AzureRmVMBootDiagnosticsModifies boot diagnostics properties of a virtual machine.SetAzureRmVMBootDiagnosticsThe Set-AzureRmVMBootDiagnostics cmdlet modifies boot diagnostics properties of a virtual machine.Set-AzureRmVMBootDiagnosticsVMSpecifies the virtual machine for which this cmdlet changes boot diagnostics. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineDisableIndicates that this cmdlet disables the boot diagnostics for the virtual machine.Set-AzureRmVMBootDiagnosticsVMSpecifies the virtual machine for which this cmdlet changes boot diagnostics. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineEnableIndicates that this cmdlet enables the boot diagnostics for the virtual machine.ResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStorageAccountNameSpecifies the name of the storage account in which to save boot diagnostics data.StringDisableIndicates that this cmdlet disables the boot diagnostics for the virtual machine.SwitchParameterSwitchParameternoneEnableIndicates that this cmdlet enables the boot diagnostics for the virtual machine.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStorageAccountNameSpecifies the name of the storage account in which to save boot diagnostics data.StringStringnoneVMSpecifies the virtual machine for which this cmdlet changes boot diagnostics. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachinePSVirtualMachinenoneExample 1: Enable boot diagnosticsPS C:\>$VM = Get-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "ContosoVM07" +PS C:\> Set-AzureRmVMBootDiagnostics -VM $VM -Enable -ResourceGroupName "ResourceGroup11" -StorageAccountName "DiagnosticStorage" +The first command gets the virtual machine named ContosoVM07 by using Get-AzureRmVM. The command stores it in the $VM variable. The second command enables boot diagnostics for the virtual machine in $VM. Diagnostics data is stored in the specified account. Get-AzureRmVMGet-AzureRmVMBootDiagnosticsDataSet-AzureRmVMChefExtensionAdds a Chef extension to a virtual machine.SetAzureRmVMChefExtensionThe Set-AzureVMChefExtension cmdlet adds the Chef extension to the virtual machine.Set-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringAutoUpgradeMinorVersionBooleanVMNameSpecifies the name of a virtual machine. This cmdlet adds the Chef extension for the virtual machine that this parameter specifies.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the Chef extension.StringBootstrapOptionsSpecifies configuration settings in the client_rb option. StringBootstrapVersionSpecifies the version of the bootstrap configuration.StringChefServerUrlSpecifies the Chef server link, as a URL.StringClientRbSpecifies the full path of the Chef client.rb.StringOrganizationNameSpecifies the organization name of the Chef extension.StringRunListSpecifies the Chef node run list.StringValidationClientNameStringLinuxIndicates that this cmdlet creates a Windows virtual machine.ValidationPemSpecifies the Chef validator .pem file pathStringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Set-AzureRmVMChefExtensionResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringAutoUpgradeMinorVersionBooleanVMNameSpecifies the name of a virtual machine. This cmdlet adds the Chef extension for the virtual machine that this parameter specifies.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the Chef extension.StringBootstrapOptionsSpecifies configuration settings in the client_rb option. StringBootstrapVersionSpecifies the version of the bootstrap configuration.StringChefServerUrlSpecifies the Chef server link, as a URL.StringClientRbSpecifies the full path of the Chef client.rb.StringOrganizationNameSpecifies the organization name of the Chef extension.StringRunListSpecifies the Chef node run list.StringValidationClientNameStringValidationPemSpecifies the Chef validator .pem file pathStringWindowsIndicates that this cmdlet creates a Windows virtual machine.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.AutoUpgradeMinorVersionBooleanBooleannoneBootstrapOptionsSpecifies configuration settings in the client_rb option. StringStringnoneBootstrapVersionSpecifies the version of the bootstrap configuration.StringStringnoneChefServerUrlSpecifies the Chef server link, as a URL.StringStringnoneClientRbSpecifies the full path of the Chef client.rb.StringStringnoneLinuxIndicates that this cmdlet creates a Windows virtual machine.SwitchParameterSwitchParameternoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the Chef extension.StringStringnoneOrganizationNameSpecifies the organization name of the Chef extension.StringStringnoneResourceGroupNameSpecifies the name of the resource group that contains the virtual machine.StringStringnoneRunListSpecifies the Chef node run list.StringStringnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringStringnoneValidationClientNameStringStringnoneValidationPemSpecifies the Chef validator .pem file pathStringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet adds the Chef extension for the virtual machine that this parameter specifies.StringStringnoneWindowsIndicates that this cmdlet creates a Windows virtual machine.SwitchParameterSwitchParameternoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Add a Chef extension to a Windows virtual machinePS C:\>Set-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup001" -VMName "WindowsVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Windows +This command adds a Chef extension to a Windows virtual machine named WindowsVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.Example 2: Add a Chef extension to a Linux virtual machinePS C:\>Set-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup002" -VMName "LinuxVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Linux +This command adds a Chef extension to a Linux virtual machine named LinuxVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.Example 3: Add a Chef extension to a Windows virtual machine with bootstrap options PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup003" -VMName "WindowsVM002" -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -BootstrapOptions '{"chef_node_name":"your_node_name","chef_server_url":"https://api.opscode.com/organizations/some-org", "validation_client_name":"some-org-validator"}' -RunList "Apache" -Windows +This command adds the Chef extension to a Windows virtual machine named WindowsVM002. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format.Get-AzureRmVMChefExtensionRemove-AzureRmVMChefExtensionSet-AzureRmVMCustomScriptExtensionAdds a custom script extension to a virtual machine. SetAzureRmVMCustomScriptExtensionThe Set-AzureRmVMCustomScriptExtension cmdlet adds a custom script Virtual Machine Extension to a virtual machine. This extension lets you run your own scripts on the virtual machine.Set-AzureRmVMCustomScriptExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies.StringArgumentSpecifies arguments that the script extension passes to the script.StringDisableAutoUpgradeMinorVersionForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the custom script extension.StringRunSpecifies the command to use that runs your script.StringSecureExecutionIndicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely.StorageAccountKeySpecifies the key for the Azure storage container.StringStorageAccountNameSpecifies the name of the Azure storage account where this cmdlet stores the script.StringStorageEndpointSuffixSpecifies the storage endpoint suffix.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.StringContainerNameSpecifies the name of the Azure storage container where this cmdlet stores the script.StringFileNameSpecifies the name of the script file.String[]ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Set-AzureRmVMCustomScriptExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies.StringArgumentSpecifies arguments that the script extension passes to the script.StringDisableAutoUpgradeMinorVersionFileUriSpecifies the URI of the script file.String[]ForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of the custom script extension.StringRunSpecifies the command to use that runs your script.StringSecureExecutionIndicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely.TypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ArgumentSpecifies arguments that the script extension passes to the script.StringStringnoneContainerNameSpecifies the name of the Azure storage container where this cmdlet stores the script.StringStringnoneDisableAutoUpgradeMinorVersionSwitchParameterSwitchParameternoneFileNameSpecifies the name of the script file.String[]String[]noneFileUriSpecifies the URI of the script file.String[]String[]noneForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringStringnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the custom script extension.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneRunSpecifies the command to use that runs your script.StringStringnoneSecureExecutionIndicates that this cmdlet makes sure that the value of the Run parameter is not logged on the server or returned to the user by using the GET extension API. The value of Run might contain secrets or passwords to be passed to the script file securely.SwitchParameterSwitchParameternoneStorageAccountKeySpecifies the key for the Azure storage container.StringStringnoneStorageAccountNameSpecifies the name of the Azure storage account where this cmdlet stores the script.StringStringnoneStorageEndpointSuffixSpecifies the storage endpoint suffix.StringStringnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.StringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet adds the custom script extension for the virtual machine that this parameter specifies.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Add a custom scriptPS C:\>Set-AzureRmVMCustomScriptExtension -ResourceGroupName "ResourceGroup11" -Location "Central US" -VMName "VirtualMachine07" -Name "ContosoTest" -TypeHandlerVersion "1.1" -StorageAccountName "Contoso" -StorageAccountKey <StorageKey> -FileName "ContosoScript.exe" -ContainerName "Scripts" +This command adds a custom script to the virtual machine named VirtualMachine07. The script file is contososcript.exe.Get-AzureRmVMCustomScriptExtensionRemove-AzureRmVMCustomScriptExtensionSet-AzureRMVMDataDiskModifies properties of a virtual machine data disk.SetAzureRMVMDataDiskThe Set-AzureRmVMDataDisk cmdlet modifies properties of a virtual machine data disk. Set-AzureRMVMDataDiskVMSpecifies the virtual machine for which this cmdlet modifies a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineNameSpecifies the name of the data disk that this cmdlet modifies. StringCachingSpecifies the caching mode of the disk. The acceptable values for this parameter are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing this value causes the virtual machine to restart. This setting affects the consistency and performance of the disk.CachingTypes]DiskSizeInGBSpecifies the size, in gigabytes, for the data disk. Int32]Set-AzureRMVMDataDiskVMSpecifies the virtual machine for which this cmdlet modifies a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachineLunSpecifies the logical unit number (LUN) of the data disk that this cmdlet modifies.Int32]CachingSpecifies the caching mode of the disk. The acceptable values for this parameter are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing this value causes the virtual machine to restart. This setting affects the consistency and performance of the disk.CachingTypes]DiskSizeInGBSpecifies the size, in gigabytes, for the data disk. Int32]CachingSpecifies the caching mode of the disk. The acceptable values for this parameter are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing this value causes the virtual machine to restart. This setting affects the consistency and performance of the disk.CachingTypes]CachingTypes]noneDiskSizeInGBSpecifies the size, in gigabytes, for the data disk. Int32]Int32]noneLunSpecifies the logical unit number (LUN) of the data disk that this cmdlet modifies.Int32]Int32]noneNameSpecifies the name of the data disk that this cmdlet modifies. StringStringnoneVMSpecifies the virtual machine for which this cmdlet modifies a data disk. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.PSVirtualMachinePSVirtualMachinenoneExample 1: Modify the caching mode of a data diskPS C:\>$VM = Get-AzureRMVM -ResourceGroupName "ResourceGroup11" -VMName "ContosoVM07" +PS C:\> Set-AzureRmVMDataDisk -VM $VM -Name "DataDisk01" -Caching ReadWrite | Update-AzureRmVM +The first command gets the virtual machine named ContosoVM07 by using Get-AzureRmVM. The command stores it in the $VM variable.The second command modifies the caching mode for the data disk named DataDisk01 on the virtual machine in $VM. The command passes the result to the Update-AzureRmVM cmdlet, which implements your changes. A change to the cashing mode causes the virtual machine to restart.Get-AzureRmVMUpdate-AzureRmVMSet-AzureRMVMDiagnosticsExtensionConfigures the Azure diagnostics extension on a virtual machine.SetAzureRMVMDiagnosticsExtensionThe Set-AzureRmVMDiagnosticsExtension cmdlet configures the Azure diagnostics extension on a virtual machine.Set-AzureRMVMDiagnosticsExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.System.StringAutoUpgradeMinorVersionIndicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version. VMNameSpecifies the name of the virtual machine on which this cmdlet operates.StringDiagnosticsConfigurationPathSpecifies the path of the configuration file.StringStorageAccountNameSpecifies the storage account name.System.StringStorageAccountKeySpecifies the storage account key.System.StringStorageAccountEndpointSpecifies the storage account endpoint.System.StringStorageContextSpecifies the Azure storage context.AzureStorageContextLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of an extension. StringAutoUpgradeMinorVersionIndicates whether this cmdlet allows the Azure guest agent to automatically update the extension to a newer minor version. SwitchParameterSwitchParameternoneDiagnosticsConfigurationPathSpecifies the path of the configuration file.StringStringnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of an extension. StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStorageAccountEndpointSpecifies the storage account endpoint.System.StringSystem.StringnoneStorageAccountKeySpecifies the storage account key.System.StringSystem.StringnoneStorageAccountNameSpecifies the storage account name.System.StringSystem.StringnoneStorageContextSpecifies the Azure storage context.AzureStorageContextAzureStorageContextnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureRmVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter.System.StringSystem.StringnoneVMNameSpecifies the name of the virtual machine on which this cmdlet operates.StringStringnoneExample 1: Enable diagnostics using a storage account specified in a diagnostics configuration filePS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath "diagnostics_publicconfig.xml" +This command uses a diagnostics configuration file to enable diagnostics. The file diagnostics_publicconfig.xml contains the public XML configuration for the diagnostics extension including the name of the storage account to which diagnostics data will be sent. The diagnostics storage account must be in the same subscription as the virtual machine.Example 2: Enable diagnostics using a storage account namePS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup1" -VMName "VirtualMachine2" -DiagnosticsConfigurationPath diagnostics_publicconfig.xml -StorageAccountName "MyStorageAccount" +This command uses the storage account name to enable diagnostics. If the diagnostics configuration does not specify a storage account name or if you want to override the diagnostics storage account name specified in the configuration file, use the StorageAccountName parameter. The diagnostics storage account must be in the same subscription as the virtual machine.Example 3: Enable diagnostics using storage account name and keyPS C:\>Set-AzureRmVMDiagnosticsExtension -ResourceGroupName "ResourceGroup01" -VMName "VirtualMachine02" -DiagnosticsConfigurationPath "diagnostics_publicconfig.xml" -StorageAccountName "MyStorageAccount" -StorageAccountKey $storage_key +This command uses the storage account name and key to enable diagnostics. If the diagnostics storage account is in a different subscription than the virtual machine then enable sending diagnostics data to that storage account by explicitly specifying its name and key.Get-AzureRmVMDiagnosticsExtensionGet-AzureRmVMExtensionImageRemove-AzureRmVMDiagnosticsExtensionSet-AzureRmVMDiskEncryptionExtensionEnables encryption on a running IaaS virtual machine in Azure.SetAzureRmVMDiskEncryptionExtensionThe Set-AzureRmVMDiskEncryptionExtension cmdlet enables encryption on a running infrastructure as a service (IaaS) virtual machine in Azure. This cmdlet enables encryption by installing the disk encryption extension on the virtual machine. If no Name parameter is specified, an extension with the default name AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines are installed. This cmdlet requires confirmation from the users as one of the steps to enable encryption requires a restart of the virtual machine. It is advised that you save your work on the virtual machine before you run this cmdlet. Set-AzureRmVMDiskEncryptionExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVolumeTypeSpecifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only.OSDataAllSequenceVersionSpecifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used.StringTypeHandlerVersionSpecifies the version of the encryption extension. StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines.StringPassphraseSpecifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system.StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.VMNameSpecifies the name of the virtual machine.StringAadClientIDSpecifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault.StringAadClientCertThumbprintSpecifies the thumbprint of the AzureActive Directory (Azure AD) application client certificate that has permissions to write secrets to KeyVault. As a prerequisite, the Azure AD client certificate must be previously deployed to the virtual machine's local computer my certificate store. The Add-AzureRmVMSecret cmdlet can be used to deploy a certificate to a virtual machine in Azure. For more details, see the Add-AzureRmVMSecret cmdlet help. The certificate must be previously deployed to the virtual machine local computer my certificate store.StringDiskEncryptionKeyVaultUrlSpecifies the KeyVault URL to which the virtual machine encryption keys should be uploaded.StringDiskEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded.StringKeyEncryptionKeyUrlSpecifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. StringKeyEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. StringKeyEncryptionAlgorithmSpecifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP.RSA-OAEPRSA1_5ForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Set-AzureRmVMDiskEncryptionExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVolumeTypeSpecifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only.OSDataAllSequenceVersionSpecifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used.StringTypeHandlerVersionSpecifies the version of the encryption extension. StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines.StringPassphraseSpecifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system.StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.VMNameSpecifies the name of the virtual machine.StringAadClientIDSpecifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault.StringAadClientSecretSpecifies the client secret of the Azure AD application that has permissions to write secrets to KeyVault.StringDiskEncryptionKeyVaultUrlSpecifies the KeyVault URL to which the virtual machine encryption keys should be uploaded.StringDiskEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded.StringKeyEncryptionKeyUrlSpecifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. StringKeyEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. StringKeyEncryptionAlgorithmSpecifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP.RSA-OAEPRSA1_5ForceForces the command to run without asking for user confirmation.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.AadClientCertThumbprintSpecifies the thumbprint of the AzureActive Directory (Azure AD) application client certificate that has permissions to write secrets to KeyVault. As a prerequisite, the Azure AD client certificate must be previously deployed to the virtual machine's local computer my certificate store. The Add-AzureRmVMSecret cmdlet can be used to deploy a certificate to a virtual machine in Azure. For more details, see the Add-AzureRmVMSecret cmdlet help. The certificate must be previously deployed to the virtual machine local computer my certificate store.StringStringnoneAadClientIDSpecifies the client ID of the Azure AD application that has permissions to write secrets to KeyVault.StringStringnoneAadClientSecretSpecifies the client secret of the Azure AD application that has permissions to write secrets to KeyVault.StringStringnoneDisableAutoUpgradeMinorVersionIndicates that this cmdlet disables auto-upgrade of the minor version of the extension.SwitchParameterSwitchParameternoneDiskEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault to which the virtual machine encryption keys should be uploaded.StringStringnoneDiskEncryptionKeyVaultUrlSpecifies the KeyVault URL to which the virtual machine encryption keys should be uploaded.StringStringnoneForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneKeyEncryptionAlgorithmSpecifies the algorithm that is used to wrap and unwrap the key encryption key of the virtual machine. The default value is RSA-OAEP.StringStringnoneKeyEncryptionKeyUrlSpecifies the URL of the key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be the full versioned URL. StringStringnoneKeyEncryptionKeyVaultIdSpecifies the resource ID of the KeyVault that contains key encryption key that is used to wrap and unwrap the virtual machine encryption key. This must be a full versioned URL. StringStringnoneNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The default value is AzureDiskEncryption for virtual machines that run the Windows operating system or AzureDiskEncryptionForLinux for Linux virtual machines.StringStringnonePassphraseSpecifies the passphrase used for encrypting Linux virtual machines only. This parameter is not used for virtual machines that run the Windows operating system.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneSequenceVersionSpecifies the sequence number of the encryption operations for a virtual machine. This is unique per each encryption operation performed on the same virtual machine. The Get-AzureRmVMExtension cmdlet can be used to retrieve the previous sequence number that was used.StringStringnoneTypeHandlerVersionSpecifies the version of the encryption extension. StringStringnoneVMNameSpecifies the name of the virtual machine.StringStringnoneVolumeTypeSpecifies the type of virtual machine volumes to perform the encryption operation. Allowed values for virtual machines that run the Windows operating system are as follows: All, OS, and Data. The allowed values for Linux virtual machines are as follows: Data only.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Enable encryption using Azure AD Client ID and Client SecretPS C:\>$RGName = "MyResourceGroup"; +PS C:\> $VMName = "MyTestVM"; +PS C:\> $AADClientID = "<clientID of your Azure AD app>"; +PS C:\> $AADClientSecret = "<clientSecret of your Azure AD app>"; +PS C:\> $VaultName= "MyKeyVault"; PS C:\> $KeyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName; PS C:\> $DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri; PS C:\> $KeyVaultResourceId = $KeyVault.ResourceId; -PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientSecret $AADClientSecret -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; - - This example enables encryption using Azure AD client ID, and client secret. - - - - - - - - - - - - - - -------------------------- Example 2: Enable encryption using Azure AD client ID and client certification thumbprint -------------------------- - - PS C:\> - - PS C:\>$RGName = "MyResourceGroup"; -PS C:\> $VMName = "MyTestVM"; +PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientSecret $AADClientSecret -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; +This example enables encryption using Azure AD client ID, and client secret.Example 2: Enable encryption using Azure AD client ID and client certification thumbprintPS C:\>$RGName = "MyResourceGroup"; +PS C:\> $VMName = "MyTestVM"; #The KeyVault must have enabledForDiskEncryption property set on it -PS C:\> $VaultName= "MyKeyVault"; +PS C:\> $VaultName= "MyKeyVault"; PS C:\> $KeyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName; PS C:\> $DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri; PS C:\> $KeyVaultResourceId = $KeyVault.ResourceId; # create Azure AD application and associate the certificate -PS C:\> $CertPath = "C:\certificates\examplecert.pfx"; -PS C:\> $CertPassword = "Password"; +PS C:\> $CertPath = "C:\certificates\examplecert.pfx"; +PS C:\> $CertPassword = "Password"; PS C:\> $Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertPath, $CertPassword); PS C:\> $KeyValue = [System.Convert]::ToBase64String($cert.GetRawCertData()); -PS C:\> $AzureAdApplication = New-AzureRmADApplication -DisplayName "<Your Application Display Name>" -HomePage "<https://YourApplicationHomePage>" -IdentifierUris "<https://YouApplicationUri>" -KeyValue $KeyValue -KeyType AsymmetricX509Cert ; +PS C:\> $AzureAdApplication = New-AzureRmADApplication -DisplayName "<Your Application Display Name>" -HomePage "<https://YourApplicationHomePage>" -IdentifierUris "<https://YouApplicationUri>" -KeyValue $KeyValue -KeyType AsymmetricX509Cert ; PS C:\> $ServicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $AzureAdApplication.ApplicationId; PS C:\> $AADClientID = $AzureAdApplication.ApplicationId; PS C:\> $aadClientCertThumbprint= $cert.Thumbprint; #Upload pfx to KeyVault -PS C:\> $KeyVaultSecretName = "MyAADCert'; +PS C:\> $KeyVaultSecretName = "MyAADCert'; PS C:\> $FileContentBytes = get-content $CertPath -Encoding Byte; PS C:\> $FileContentEncoded = [System.Convert]::ToBase64String($fileContentBytes); -PS C:\> $JSONObject = @" { "data": "$filecontentencoded", "dataType" :"pfx", "password": "$CertPassword" } "@ ; +PS C:\> $JSONObject = @" { "data": "$filecontentencoded", "dataType" :"pfx", "password": "$CertPassword" } "@ ; PS C:\> $JSONObjectBytes = [System.Text.Encoding]::UTF8.GetBytes($jsonObject); PS C:\> $JSONEncoded = [System.Convert]::ToBase64String($jsonObjectBytes); @@ -22148,90 +546,52 @@ PS C:\> Set-AzureRmKeyVaultAccessPolicy -VaultName $VaultName -ResourceGroupN PS C:\> $CertUrl = (Get-AzureKeyVaultSecret -VaultName $VaultName -Name $KeyVaultSecretName).Id $SourceVaultId = (Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName).ResourceId PS C:\> $VM = Get-AzureRmVM -ResourceGroupName $RGName -Name $VMName -PS C:\> $VM = Add-AzureRmVMSecret -VM $VM -SourceVaultId $SourceVaultId -CertificateStore "My" -CertificateUrl $CertUrl +PS C:\> $VM = Add-AzureRmVMSecret -VM $VM -SourceVaultId $SourceVaultId -CertificateStore "My" -CertificateUrl $CertUrl PS C:\> Update-AzureRmVM -VM $VM -ResourceGroupName $RGName #Enable encryption on the virtual machine using Azure AD client ID and client cert thumbprint -PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientCertThumbprint $AADClientCertThumbprint -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; - - This example enables encryption using Azure AD client ID and client certification thumbprints. - - - - - - - - - - - - - - -------------------------- Example 3: Enable encryption using Azure AD client ID, client secret, and wrap disk encryption key by using key encryption key -------------------------- - - PS C:\> - - PS C:\>$RGName = "MyResourceGroup"; -PS C:\> $VMName = "MyTestVM"; +PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientCertThumbprint $AADClientCertThumbprint -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; +This example enables encryption using Azure AD client ID and client certification thumbprints.Example 3: Enable encryption using Azure AD client ID, client secret, and wrap disk encryption key by using key encryption keyPS C:\>$RGName = "MyResourceGroup"; +PS C:\> $VMName = "MyTestVM"; -PS C:\> $AADClientID = "<clientID of your Azure AD app>"; -PS C:\> $AADClientSecret = "<clientSecret of your Azure AD app>"; +PS C:\> $AADClientID = "<clientID of your Azure AD app>"; +PS C:\> $AADClientSecret = "<clientSecret of your Azure AD app>"; -PS C:\> $VaultName= "MyKeyVault"; +PS C:\> $VaultName= "MyKeyVault"; PS C:\> $KeyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName; PS C:\> $DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri; PS C:\> $KeyVaultResourceId = $KeyVault.ResourceId; -PS C:\> $KEK = Add-AzureKeyVaultKey -VaultName $VaultName -Name $KEKName -Destination "Software" +PS C:\> $KEK = Add-AzureKeyVaultKey -VaultName $VaultName -Name $KEKName -Destination "Software" PS C:\> $KeyEncryptionKeyUrl = $KEK.Key.kid; -PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientSecret $AADClientSecret -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $KeyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId; - - This example enables encryption using Azure AD client ID, client secret, and wrap disk encryption key by using the key encryption key. - - - - - - - - - - - - - - -------------------------- Example 4: Enable encryption using Azure AD client ID, client cert thumbprint, and wrap disk encryptionkey by using key encryption key -------------------------- - - PS C:\> - - PS C:\>$RGName = "MyResourceGroup"; -PS C:\> $VMName = "MyTestVM"; +PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGName -VMName $VMName -AadClientID $AADClientID -AadClientSecret $AADClientSecret -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $KeyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId; +This example enables encryption using Azure AD client ID, client secret, and wrap disk encryption key by using the key encryption key.Example 4: Enable encryption using Azure AD client ID, client cert thumbprint, and wrap disk encryptionkey by using key encryption keyPS C:\>$RGName = "MyResourceGroup"; +PS C:\> $VMName = "MyTestVM"; #The KeyVault must have enabledForDiskEncryption property set on it -PS C:\> $VaultName= "MyKeyVault"; +PS C:\> $VaultName= "MyKeyVault"; PS C:\> $KeyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName; PS C:\> $DiskEncryptionKeyVaultUrl = $KeyVault.VaultUri; PS C:\> $KeyVaultResourceId = $KeyVault.ResourceId; -PS C:\> $KEK = Add-AzureKeyVaultKey -VaultName $VaultName -Name $KEKName -Destination "Software" +PS C:\> $KEK = Add-AzureKeyVaultKey -VaultName $VaultName -Name $KEKName -Destination "Software" PS C:\> $KeyEncryptionKeyUrl = $KEK.Key.kid; PS C:\> # create Azure AD application and associate the certificate -PS C:\> $CertPath = "C:\certificates\examplecert.pfx"; -PS C:\> $CertPassword = "Password"; +PS C:\> $CertPath = "C:\certificates\examplecert.pfx"; +PS C:\> $CertPassword = "Password"; PS C:\> $Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertPath, $CertPassword); PS C:\> $KeyValue = [System.Convert]::ToBase64String($cert.GetRawCertData()); -PS C:\> $AzureAdApplication = New-AzureRmADApplication -DisplayName "<Your Application Display Name>" -HomePage "<https://YourApplicationHomePage>" -IdentifierUris "<https://YouApplicationUri>" -KeyValue $KeyValue -KeyType AsymmetricX509Cert ; +PS C:\> $AzureAdApplication = New-AzureRmADApplication -DisplayName "<Your Application Display Name>" -HomePage "<https://YourApplicationHomePage>" -IdentifierUris "<https://YouApplicationUri>" -KeyValue $KeyValue -KeyType AsymmetricX509Cert ; PS C:\> $ServicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $AzureAdApplication.ApplicationId; PS C:\> $AADClientID = $AzureAdApplication.ApplicationId; PS C:\> $AADClientCertThumbprint= $Cert.Thumbprint; #Upload pfx to KeyVault -PS C:\> $KeyVaultSecretName = "MyAADCert"; +PS C:\> $KeyVaultSecretName = "MyAADCert"; PS C:\> $FileContentBytes = get-content $CertPath -Encoding Byte; PS C:\> $FileContentEncoded = [System.Convert]::ToBase64String($FileContentBytes); -$JSONObject = @" { "data": "$filecontentencoded", "dataType" :"pfx", "password": "$CertPassword" } "@ ; +$JSONObject = @" { "data": "$filecontentencoded", "dataType" :"pfx", "password": "$CertPassword" } "@ ; PS C:\> $JSONObjectBytes = [System.Text.Encoding]::UTF8.GetBytes($JSONObject);$jsonEncoded = [System.Convert]::ToBase64String($JSONObjectBytes); PS C:\> $Secret = ConvertTo-SecureString -String $JSONEncoded -AsPlainText -Force; @@ -22242,6449 +602,111 @@ PS C:\> Set-AzureRmKeyVaultAccessPolicy -VaultName $VaultName -ResourceGroupN PS C:\> $CertUrl = (Get-AzureKeyVaultSecret -VaultName $VaultName -Name $KeyVaultSecretName).Id PS C:\> $SourceVaultId = (Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $RGName).ResourceId PS C:\> $VM = Get-AzureRmVM -ResourceGroupName $RGName -Name $VMName -PS C:\> $VM = Add-AzureRmVMSecret -VM $VM -SourceVaultId $SourceVaultId -CertificateStore "My" -CertificateUrl $CertUrl +PS C:\> $VM = Add-AzureRmVMSecret -VM $VM -SourceVaultId $SourceVaultId -CertificateStore "My" -CertificateUrl $CertUrl PS C:\> Update-AzureRmVM -VM $VM -ResourceGroupName $RGName #Enable encryption on the virtual machine using Azure AD client ID and client cert thumbprint -PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGname -VMName $VMName -AadClientID $AADClientID -AadClientCertThumbprint $AADClientCertThumbprint -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; - - This example enables encryption using Azure AD client ID, client cert thumbprint, and wrap disk encryption key by using key encryption key. - - - - - - - - - - - - - - - - Add-AzureRmVMSecret - - - - Get-AzureRmVMDiskEncryptionStatus - - - - Remove-AzureRmVMDiskEncryptionExtension - - - - - - - - Set-AzureRmVMDscExtension - - Configures the DSC extension on a virtual machine. - - - - - Set - AzureRmVMDscExtension - - - - The Set-AzureRmVMDscExtension cmdlet configures the Windows PowerShell Desired State Configuration (DSC) extension on a virtual machine in a resource group. - - - - Set-AzureRmVMDscExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of the virtual machine where DSC extension handler is installed. - - String - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is Microsoft.Powershell.DSC. - - String - - - ArchiveBlobName - - Specifies the name of the configuration file that was previously uploaded by the Publish-AzureRmVMDscConfiguration cmdlet. - - String - - - ArchiveStorageAccountName - - Specifies the Azure storage account name that is used to download the ArchiveBlobName. - - String - - - ArchiveResourceGroupName - - Specifies the name of the resource group that contains the storage account that contains the configuration archive. This parameter is optional if the storage account and virtual machine are both in the same resource group. - - String - - - ArchiveStorageEndpointSuffix - - Specifies the storage endpoint suffix. - - String - - - ArchiveContainerName - - Species name of the Azure storage container where the configuration archive is located. - - String - - - ConfigurationName - - Specifies the name of the configuration that the DSC Extension invokes. - - String - - - ConfigurationArgument - - Specifies a hash table that contains the arguments to the configuration function. - - Hashtable - - - ConfigurationData - - Specifies the path of a .psd1 file that specifies the data for the configuration. - - String - - - Version - - Specifies the version of the DSC extension that Set-AzureRmVMDscExtension applies the settings to. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - Location - - Specifies the path of the resource extension. - - String - - - AutoUpdate - - Specifies the extension handler version specified by the Version parameter. By default extension handler is not autoupdated. Use the AutoUpdate parameter to enable auto update of the extension handler to the latest version as and when it is available. - - SwitchParameter - - - WmfVersion - - - Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are "4.0","5.0","5.1PP","latest".A value of "4.0" will install WMF 4.0 Update packages (https://support.microsoft.com/en-us/kb/3119938) on Windows 8.1 or Windows Server 2012 R2, or (https://support.microsoft.com/en-us/kb/3109118) on Windows Server 2008 R2 and on other versions of Windows if newer version is not already installed. A value of "5.0" will install the latest release of WMF 5.0 (https://www.microsoft.com/en-us/download/details.aspx?id=50395). A value of "5.1PP" will install the WMF 5.1 preview (https://www.microsoft.com/en-us/download/details.aspx?id=53347). A value of "latest" will install the latest WMF, currently WMF 5.0. The default value is "latest" - - - String - - - DataCollection - - Specifies the data collection type. The acceptable values for this parameter are: Enable and Disable. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of the virtual machine where DSC extension handler is installed. - - String - - String - - - none - - - Name - - Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is Microsoft.Powershell.DSC. - - String - - String - - - none - - - ArchiveBlobName - - Specifies the name of the configuration file that was previously uploaded by the Publish-AzureRmVMDscConfiguration cmdlet. - - String - - String - - - none - - - ArchiveStorageAccountName - - Specifies the Azure storage account name that is used to download the ArchiveBlobName. - - String - - String - - - none - - - ArchiveResourceGroupName - - Specifies the name of the resource group that contains the storage account that contains the configuration archive. This parameter is optional if the storage account and virtual machine are both in the same resource group. - - String - - String - - - none - - - ArchiveStorageEndpointSuffix - - Specifies the storage endpoint suffix. - - String - - String - - - none - - - ArchiveContainerName - - Species name of the Azure storage container where the configuration archive is located. - - String - - String - - - none - - - ConfigurationName - - Specifies the name of the configuration that the DSC Extension invokes. - - String - - String - - - none - - - ConfigurationArgument - - Specifies a hash table that contains the arguments to the configuration function. - - Hashtable - - Hashtable - - - none - - - ConfigurationData - - Specifies the path of a .psd1 file that specifies the data for the configuration. - - String - - String - - - none - - - Version - - Specifies the version of the DSC extension that Set-AzureRmVMDscExtension applies the settings to. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - Location - - Specifies the path of the resource extension. - - String - - String - - - none - - - AutoUpdate - - Specifies the extension handler version specified by the Version parameter. By default extension handler is not autoupdated. Use the AutoUpdate parameter to enable auto update of the extension handler to the latest version as and when it is available. - - SwitchParameter - - SwitchParameter - - - none - - - WmfVersion - - - Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are "4.0","5.0","5.1PP","latest".A value of "4.0" will install WMF 4.0 Update packages (https://support.microsoft.com/en-us/kb/3119938) on Windows 8.1 or Windows Server 2012 R2, or (https://support.microsoft.com/en-us/kb/3109118) on Windows Server 2008 R2 and on other versions of Windows if newer version is not already installed. A value of "5.0" will install the latest release of WMF 5.0 (https://www.microsoft.com/en-us/download/details.aspx?id=50395). A value of "5.1PP" will install the WMF 5.1 preview (https://www.microsoft.com/en-us/download/details.aspx?id=53347). A value of "latest" will install the latest WMF, currently WMF 5.0. The default value is "latest" - - - String - - String - - - latest - - - DataCollection - - Specifies the data collection type. The acceptable values for this parameter are: Enable and Disable. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - false - - - Confirm - - Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set a DSC extension -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM07" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -Version "1.10" -Location "West US" - - This command sets the DSC extension on the virtual machine named VM07 to download Sample.ps1.zip from the storage account named Stg and the default container. The command invokes the configuration named ConfigName. The Sample.ps1.zip file was previously uploaded by using Publish-AzureRmVMDscConfiguration. - - - - - - - - - - - - - - -------------------------- Example 2: Set a DSC extension with configuration data -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM13" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName "WindowsPowerShellDSC" -ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US" - - This command sets the extension on the virtual machine named VM13 to download Sample.ps1.zip from the storage account named Stg and the container named WindowsPowerShellDSC. The command the configuration named ConfigName and specifies configuration data and arguments. The Sample.ps1.zip file was previously uploaded by using Publish-AzureRmVMDscConfiguration. - - - - - - - - - - - - - - -------------------------- Example 3: Set a DSC extension with configuration data that has auto update -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM22" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName WindowsPowerShellDSC -ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US" -AutoUpdate - - This command sets the extension on the virtual machine named VM22 to download Sample.ps1.zip from the storage account named Stg and the container named WindowsPowerShellDSC. The command invokes the configuration named ConfigName and specifies configuration data and arguments. This command also enables auto update of extension handler to the latest version. The Sample.ps1.zip was previously uploaded by using Publish-AzureRmVMDscConfiguration. - - - - - - - - - - - - - - - - Get-AzureRmVMDscExtension - - - - Remove-AzureRmVMDscExtension - - - - Publish-AzureRmVMDscConfiguration - - - - - - - - Set-AzureRmVMExtension - - Updates extension properties or adds an extension to a virtual machine. - - - - - Set - AzureRmVMExtension - - - - The Set-AzureRmVMExtension cmdlet updates properties for existing Virtual Machine Extensions or adds an extension to a virtual machine. - - - - Set-AzureRmVMExtension - - Publisher - - Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. - - String - - - ExtensionType - - Specifies the extension type. - - String - - - Settings - - Specifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration. - - Hashtable - - - ProtectedSettings - - Specifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration. - - Hashtable - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of an extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions. - - SwitchParameter - - - ForceRerun - - Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMExtension - - Publisher - - Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. - - String - - - ExtensionType - - Specifies the extension type. - - String - - - SettingString - - Specifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration. - - String - - - ProtectedSettingString - - Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration. - - String - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. - - String - - - Name - - Specifies the name of an extension. - - String - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - - Location - - Specifies the location of the virtual machine. - - String - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions. - - SwitchParameter - - - ForceRerun - - Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Publisher - - Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. - - String - - String - - - none - - - ExtensionType - - Specifies the extension type. - - String - - String - - - none - - - Settings - - Specifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration. - - Hashtable - - Hashtable - - - none - - - ProtectedSettings - - Specifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration. - - Hashtable - - Hashtable - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. - - String - - String - - - none - - - Name - - Specifies the name of an extension. - - String - - String - - - none - - - TypeHandlerVersion - - Specifies the version of the extension to use for this virtual machine. - - String - - String - - - none - - - Location - - Specifies the location of the virtual machine. - - String - - String - - - none - - - DisableAutoUpgradeMinorVersion - - Indicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions. - - SwitchParameter - - SwitchParameter - - - none - - - ForceRerun - - Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - SettingString - - Specifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration. - - String - - String - - - none - - - ProtectedSettingString - - Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Modify settings by using hash tables -------------------------- - - PS C:\> - - PS C:\>$Settings = @{"fileUris" = "[]"; "commandToExecute" = ""}; -PS C:\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey}; -PS C:\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "ContosoTest" -Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -Settings $Settings -ProtectedSettings $ProtectedSettings; - - The first two commands use standard Windows PowerShell syntax to create hash tables, and then stores those hash tables in the $Settings and $ProtectedSettings variables. For more information, type Get-Help about_Hash_Tables. The second command includes two values previously created and stored in variables. - - - - - - - - - - - - - - -------------------------- Example 2: Modify settings by using strings -------------------------- - - PS C:\> - - PS C:\>$SettingsString = '{"fileUris":[],"commandToExecute":""}'; -PS C:\> $ProtectedSettingsString = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}'; -PS C:\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -SettingString $SettingsString -ProtectedSettingString $ProtectedSettingsString ; - - The first two commands create strings that contain settings, and then stores them in the $SettingsString and $ProtectedSettingsString variables. - - - - - - - - - - - - - - - - Get-AzureRmVMExtension - - - - Remove-AzureRmVMExtension - - - - - - - - Set-AzureRmVMOperatingSystem - - Sets operating system properties for a virtual machine. - - - - - Set - AzureRmVMOperatingSystem - - - - The Set-AzureRmVMOperatingSystem cmdlet sets operating system properties for a virtual machine. You can specify logon credentials, computer name, and operating system type. - - - - Set-AzureRmVMOperatingSystem - - VM - - Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - - Windows - - Indicates that the type of operating system is Windows. - - SwitchParameter - - - ComputerName - - Specifies the name of the computer. - - String - - - Credential - - Specifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential. - - PSCredential - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - - ProvisionVMAgent - - Indicates that the settings require that the virtual machine agent be installed on the virtual machine. - - SwitchParameter - - - EnableAutoUpdate - - Indicates that this cmdlet enables auto update. - - SwitchParameter - - - TimeZone - - Specifies the time zone for the virtual machine. - - String - - - WinRMHttp - - Indicates that this operating system uses HTTP WinRM. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOperatingSystem - - VM - - Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - - Windows - - Indicates that the type of operating system is Windows. - - SwitchParameter - - - ComputerName - - Specifies the name of the computer. - - String - - - Credential - - Specifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential. - - PSCredential - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - - ProvisionVMAgent - - Indicates that the settings require that the virtual machine agent be installed on the virtual machine. - - SwitchParameter - - - EnableAutoUpdate - - Indicates that this cmdlet enables auto update. - - SwitchParameter - - - TimeZone - - Specifies the time zone for the virtual machine. - - String - - - WinRMHttp - - Indicates that this operating system uses HTTP WinRM. - - SwitchParameter - - - WinRMHttps - - Indicates that this operating system uses HTTPS WinRM. - - SwitchParameter - - - WinRMCertificateUrl - - Specifies the URI of a WinRM certificate. This needs to be stored in a Key Vault. - - Uri - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOperatingSystem - - VM - - Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - - Linux - - Indicates that the type of operating system is Linux. - - SwitchParameter - - - ComputerName - - Specifies the name of the computer. - - String - - - Credential - - Specifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential. - - PSCredential - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - - DisablePasswordAuthentication - - Indicates that this cmdlet disables password authentication. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Windows - - Indicates that the type of operating system is Windows. - - SwitchParameter - - SwitchParameter - - - none - - - ComputerName - - Specifies the name of the computer. - - String - - String - - - none - - - Credential - - Specifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential. - - PSCredential - - PSCredential - - - none - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - String - - - none - - - ProvisionVMAgent - - Indicates that the settings require that the virtual machine agent be installed on the virtual machine. - - SwitchParameter - - SwitchParameter - - - none - - - EnableAutoUpdate - - Indicates that this cmdlet enables auto update. - - SwitchParameter - - SwitchParameter - - - none - - - TimeZone - - Specifies the time zone for the virtual machine. - - String - - String - - - none - - - WinRMHttp - - Indicates that this operating system uses HTTP WinRM. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WinRMHttps - - Indicates that this operating system uses HTTPS WinRM. - - SwitchParameter - - SwitchParameter - - - none - - - WinRMCertificateUrl - - Specifies the URI of a WinRM certificate. This needs to be stored in a Key Vault. - - Uri - - Uri - - - none - - - Linux - - Indicates that the type of operating system is Linux. - - SwitchParameter - - SwitchParameter - - - none - - - DisablePasswordAuthentication - - Indicates that this cmdlet disables password authentication. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set operating system properties for a new virtual machines -------------------------- - - PS C:\> - - PS C:\>$SecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force -PS C:\> $Credential = New-Object System.Management.Automation.PSCredential ("FullerP", $SecurePassword); -PS C:\> $AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id -PS C:\> $ComputerName = "ContosoVM122" -PS C:\> $WinRMCertUrl = "http://keyVaultName.vault.azure.net/secrets/secretName/secretVersion" -PS C:\> $TimeZone = "Pacific Standard Time" -PS C:\> $CustomData = "echo 'Hello World'" -PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $$VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -CustomData $CustomData -WinRMHttp -WinRMHttps -WinRMCertificateUrl $WinRMCertUrl -ProvisionVMAgent -EnableAutoUpdate -TimeZone $TimeZone - - The first command converts a password to a secure string, and then stores it in the $SecurePassword variable. For more information, type Get-Help ConvertTo-SecureString. - - - The fourth command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVMConfig - - - - - - - - Set-AzureRmVMOSDisk - - Sets the operating system disk properties on a virtual machine. - - - - - Set - AzureRmVMOSDisk - - - - The Set-AzureRmVMOSDisk cmdlet set the operating system disk properties on a virtual machine. - - - - Set-AzureRmVMOSDisk - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the operating system disk. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - - DiskSizeInGB - - - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOSDisk - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the operating system disk. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - - Windows - - Indicates that the operating system on the user image is Windows. - - SwitchParameter - - - DiskSizeInGB - - - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOSDisk - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the operating system disk. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - - Windows - - Indicates that the operating system on the user image is Windows. - - SwitchParameter - - - DiskEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - - DiskEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - - KeyEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - - KeyEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - - DiskSizeInGB - - - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOSDisk - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the operating system disk. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - - Linux - - Indicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment. - - SwitchParameter - - - DiskSizeInGB - - - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureRmVMOSDisk - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - - Name - - Specifies the name of the operating system disk. - - String - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - - Linux - - Indicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment. - - SwitchParameter - - - DiskEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - - DiskEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - - KeyEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - - KeyEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - - DiskSizeInGB - - - - Nullable`1[Int32] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Name - - Specifies the name of the operating system disk. - - String - - String - - - none - - - VhdUri - - Specifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD). - For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. - For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. - - String - - String - - - none - - - Caching - - Specifies the caching mode of the operating system disk. Valid values are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - Nullable`1[CachingTypes] - - - none - - - SourceImageUri - - Specifies the consistency and performance of the disk. - - String - - String - - - none - - - CreateOption - - Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: - -- Attach. Specify this option to create a VM from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. --- FromImage. Specify this option to create a VM from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. - Specifies the consistency and performance of the disk. - - DiskCreateOptionTypes - - DiskCreateOptionTypes - - - none - - - DiskSizeInGB - - - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Windows - - Indicates that the operating system on the user image is Windows. - - SwitchParameter - - SwitchParameter - - - none - - - DiskEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - String - - - none - - - DiskEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - String - - - none - - - KeyEncryptionKeyUrl - - Specifies the consistency and performance of the disk. - - String - - String - - - none - - - KeyEncryptionKeyVaultId - - Specifies the consistency and performance of the disk. - - String - - String - - - none - - - Linux - - Indicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set properties on a virtual machine from platform image -------------------------- - - PS C:\> - - PS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id -PS C:\> Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "OsDisk12" -VhdUri "os.vhd" -Caching ReadWrite -PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName "MainComputer" -Credential (Get-Credential) -PS C:\> $VirtualMachine = Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName "Canonical" -Offer "UbuntuServer" -Skus "15.10" -Version "latest" -Caching ReadWrite -PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption FromImage -PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" - - The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine. - - - - - - - - - - - - - - -------------------------- Example 2: Sets properties on a virtual machine from generalized user image -------------------------- - - PS C:\> - - PS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" -PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName "MainComputer" -Credential (Get-Credential) -PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -SourceImageUri "https://mystorageaccount.blob.core.windows.net/vhds/myOSImage.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption fromImage -Linux -PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" - - The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11 and stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine. - - - - - - - - - - - - - - -------------------------- Example 3: Sets properties on a virtual machine from specialized user image -------------------------- - - PS C:\> - - PS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" -PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption Attach -Linux -PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" - - The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11 and stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine. - - - - - - - - - - - - - - -------------------------- Example 4: Set the disk encryption settings on a virtual machine operating system disk -------------------------- - - PS C:\> - - PS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" -PS C:> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "OsDisk12" -VhdUri "os.vhd" -Caching ReadWrite -Windows -CreateOption "Attach" -DiskEncryptionKeyUrl "https://mytestvault.vault.azure.net/secrets/Test1/514ceb769c984379a7e0230bddaaaaaa" -DiskEncryptionKeyVaultId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.KeyVault/vaults/mytestvault" -PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName " ResourceGroup11" - - This example sets the disk encryption settings on a virtual machine operating system disk. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - Get-AzureRmAvailabilitySet - - - - New-AzureRmVMConfig - - - - - - - - Set-AzureRmVMPlan - - Sets the Marketplace plan information on a virtual machine. - - - - - Set - AzureRmVMPlan - - - - The Set-AzureRmVMPlan cmdlet sets the Azure Marketplace plan information for a virtual machine. - Before being able to deploy a Marketplace image through the command-line, programmatic access must be enabled or the virtual machine must be deployed by using the Azure portal. - - - - Set-AzureRmVMPlan - - VM - - Specifies the virtual machine object for which to set a Marketplace plan. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - - Name - - Specifies the name of the image from the Marketplace. This is the same value that is returned by the Get-AzureRmVMImageSku cmdlet. For more information about how to find image information, see Navigating and Selecting Azure Virtual Machine images with PowerShell and the Azure CLI (https://azure.microsoft.com/documentation/articles/resource-groups-vm-searching/) in the Microsoft Azure documentation. - - String - - - Product - - Specifies the product of the image from the Marketplace. This is the same information as the Offer value of the imageReference element. - - String - - - PromotionCode - - Specifies a promotion code. - - String - - - Publisher - - Specifies the publisher of the image. You can find this information by using the Get-AzureRmVMImagePublisher cmdlet. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the virtual machine object for which to set a Marketplace plan. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Name - - Specifies the name of the image from the Marketplace. This is the same value that is returned by the Get-AzureRmVMImageSku cmdlet. For more information about how to find image information, see Navigating and Selecting Azure Virtual Machine images with PowerShell and the Azure CLI (https://azure.microsoft.com/documentation/articles/resource-groups-vm-searching/) in the Microsoft Azure documentation. - - String - - String - - - none - - - Product - - Specifies the product of the image from the Marketplace. This is the same information as the Offer value of the imageReference element. - - String - - String - - - none - - - PromotionCode - - Specifies a promotion code. - - String - - String - - - none - - - Publisher - - Specifies the publisher of the image. You can find this information by using the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - - - - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageSku - - - - New-AzureRmVMConfig - - - - - - - - Set-AzureRmVMSourceImage - - Specifies the platform image for a virtual machine. - - - - - Set - AzureRmVMSourceImage - - - - The Set-AzureRmVMSourceImage cmdlet specifies the platform image to use for a virtual machine. - - - - Set-AzureRmVMSourceImage - - VM - - Specifies the local virtual machine object to configure. - - PSVirtualMachine - - - PublisherName - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - Offer - - Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - - Skus - - Specifies a VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet. - - String - - - Version - - Specifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies the local virtual machine object to configure. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - PublisherName - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - Offer - - Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - String - - - none - - - Skus - - Specifies a VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet. - - String - - String - - - none - - - Version - - Specifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set values for an image -------------------------- - - PS C:\> - - PS C:\>AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id -PS C:\> Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Skus "2012-R2-Datacenter" -Version "latest" - - The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. - - - - - - - - - - - - - - -------------------------- Example 2: Use the image reference method to set values -------------------------- - - PS C:\> - - PS C:\>$Publisher = (Get-AzureRmVMImagePublisher -Location "Central US") | select -ExpandProperty PublisherName | where { $_ -like '*Microsoft*Windows*Server' } -PS C:\> $Offer = (Get-AzureRmVMImageOffer -Location "Central US" -PublisherName $Publisher[0]) | select -ExpandProperty Offer | where { $_ -like '*Windows*' } -PS C:\> $Sku = (Get-AzureRmVMImageSku -Location "Central US" -PublisherName $Publisher[0] -Offer $Offer[0]) | select -ExpandProperty Skus -PS C:\> $Versions = (Get-AzureRmVMImage -Location "Central US" -Offer -Offer $Offer[0] -PublisherName $Publisher[0] -Skus $Sku[0]) | select -ExpandProperty Version -PS C:\> $VMImage = Get-AzureRmVMImage -Location "Central US" -Offer -Offer $Offer[0] -PublisherName $Publisher[0] -Skus $Sku[0] -Version $Versions[0] -PS C:\> $VirtualMachine07 = Set-AzureRmVMSourceImage -VM $VirtualMachine07 -ImageReference $VMImage - - This example sets source image settings by using the image reference method. - - - - - - - - - - - - - - - - Get-AzureRmAvailabilitySet - - - - New-AzureRmVMConfig - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImageSku - - - - Get-AzureRmVMImage - - - - - - - - Set-AzureRmVMSqlServerExtension - - - - - - - Set - AzureRmVMSqlServerExtension - - - - - - - - Set-AzureRmVMSqlServerExtension - - Version - - - - String - - - ResourceGroupName - - - - String - - - VMName - - - - String - - - Name - - - - String - - - AutoPatchingSettings - - - - AutoPatchingSettings - - - AutoBackupSettings - - - - AutoBackupSettings - - - KeyVaultCredentialSettings - - - - KeyVaultCredentialSettings - - - Location - - - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Version - - - - String - - String - - - none - - - ResourceGroupName - - - - String - - String - - - none - - - VMName - - - - String - - String - - - none - - - Name - - - - String - - String - - - none - - - AutoPatchingSettings - - - - AutoPatchingSettings - - AutoPatchingSettings - - - none - - - AutoBackupSettings - - - - AutoBackupSettings - - AutoBackupSettings - - - none - - - KeyVaultCredentialSettings - - - - KeyVaultCredentialSettings - - KeyVaultCredentialSettings - - - - - - Location - - - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Set-AzureRmVmss - - Sets specific actions on a specified VMSS. - - - - - Set - AzureRmVmss - - - - The Set-AzureRmVmss cmdlet sets specific actions on the Virtual Machine Scale Set (VMSS). The only action this cmdlet supports is Reimage. - - - - Set-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Species the name of the VMSS for which this cmdlet sets actions on. - - String - - - Reimage - - Indicates that the cmdlet reimages the VMSS. - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Species the name of the VMSS for which this cmdlet sets actions on. - - String - - String - - - none - - - Reimage - - Indicates that the cmdlet reimages the VMSS. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Reimage a VMSS -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVmss -Reimage -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" - - This command reimages the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Start-AzureRmVmss - - - - Stop-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Set-AzureRmVmssOsProfile - - Sets the VMSS operating system profile properties. - - - - - Set - AzureRmVmssOsProfile - - - - The Set-AzureRmVmssOsProfile cmdlet sets the Virtual Machine Scale Set operating system profile properties. - - - - Set-AzureRmVmssOsProfile - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - - ComputerNamePrefix - - Specifies the computer name prefix for all the virtual machine instances in the VMSS. Computer names must be 1 to 15 characters long. - - String - - - AdminUsername - - Specifies the administrator account name to use for all the virtual machine instances in the VMSS. - - String - - - AdminPassword - - Specifies the administrator password to use for all the virtual machine instances in the VMSS. - - String - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - - WindowsConfigurationProvisionVMAgent - - Indicates whether virtual machine agent should be provisioned on the virtual machines in the VMSS. - - Nullable`1[Boolean] - - - WindowsConfigurationEnableAutomaticUpdate - - Indicates whether the virtual machines in the VMSS are enabled for automatic updates. - - Nullable`1[Boolean] - - - TimeZone - - Specifies the time zone for the virtual machine. - - String - - - AdditionalUnattendContent - - Specifies an unattended content object. You can use the Add-AzureRmVMAdditionalUnattendContent to create the object. - - AdditionalUnattendContent[] - - - Listener - - Specifies the Windows Remote Management (WinRM) listeners. This enables remote Windows PowerShell®. You can use the Add-AzureRmVmssWinRMListener cmdlet to create the listener. - - WinRMListener[] - - - LinuxConfigurationDisablePasswordAuthentication - - Indicates that this cmdlet disables password authentication. - - Nullable`1[Boolean] - - - PublicKey - - Specifies the Secure Shell (SSH) public key object. You can use the Add-AzureRmVMSshPublicKey cmdlet to create the object. - - SshPublicKey[] - - - Secret - - Specifies the secrets object which contains the certificate references to place on the virtual machine. You can use the Add-AzureRmVmssSecret cmdlet to create the secrets object. - - VaultSecretGroup[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - ComputerNamePrefix - - Specifies the computer name prefix for all the virtual machine instances in the VMSS. Computer names must be 1 to 15 characters long. - - String - - String - - - none - - - AdminUsername - - Specifies the administrator account name to use for all the virtual machine instances in the VMSS. - - String - - String - - - none - - - AdminPassword - - Specifies the administrator password to use for all the virtual machine instances in the VMSS. - - String - - String - - - none - - - CustomData - - Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes. - - String - - String - - - none - - - WindowsConfigurationProvisionVMAgent - - Indicates whether virtual machine agent should be provisioned on the virtual machines in the VMSS. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - WindowsConfigurationEnableAutomaticUpdate - - Indicates whether the virtual machines in the VMSS are enabled for automatic updates. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - TimeZone - - Specifies the time zone for the virtual machine. - - String - - String - - - none - - - AdditionalUnattendContent - - Specifies an unattended content object. You can use the Add-AzureRmVMAdditionalUnattendContent to create the object. - - AdditionalUnattendContent[] - - AdditionalUnattendContent[] - - - none - - - Listener - - Specifies the Windows Remote Management (WinRM) listeners. This enables remote Windows PowerShell®. You can use the Add-AzureRmVmssWinRMListener cmdlet to create the listener. - - WinRMListener[] - - WinRMListener[] - - - none - - - LinuxConfigurationDisablePasswordAuthentication - - Indicates that this cmdlet disables password authentication. - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - none - - - PublicKey - - Specifies the Secure Shell (SSH) public key object. You can use the Add-AzureRmVMSshPublicKey cmdlet to create the object. - - SshPublicKey[] - - SshPublicKey[] - - - none - - - Secret - - Specifies the secrets object which contains the certificate references to place on the virtual machine. You can use the Add-AzureRmVmssSecret cmdlet to create the secrets object. - - VaultSecretGroup[] - - VaultSecretGroup[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set the operating system profile properties for a VMSS -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVmssOSProfile -VirtualMachineScaleSet "ContosoVMSS" -ComputerNamePrefix "Test" -AdminUsername $AdminUsername -AdminPassword $AdminPassword - - This command sets operating system profile properties for the virtual machines that belong to the VMSS named ContosoVMSS. The command sets the computer name prefix for all the virtual machine instances in the VMSS to Test and supplies the administrator username and password. - - - - - - - - - - - - - - - - Add-AzureRmVMAdditionalUnattendContent - - - - Add-AzureRmVmssWinRMListener - - - - Add-AzureRmVMSshPublicKey - - - - Add-AzureRmVmssSecret - - - - New-AzureRmVmssConfig - - - - - - - - Set-AzureRmVmssStorageProfile - - Sets the storage profile properties for the VMSS. - - - - - Set - AzureRmVmssStorageProfile - - - - The Set-AzureRmVmssStorageProfile cmdlet sets the storage profile properties for the Virtual Machine Scale Set (VMSS). - - - - Set-AzureRmVmssStorageProfile - - VirtualMachineScaleSet - - Specifies the VMSS object. To obtain the object, use the New-AzureRmVmssConfig object. - - VirtualMachineScaleSet - - - ImageReferencePublisher - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - - ImageReferenceOffer - - Specifies the type of virtual machine image (VMImage) offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - - ImageReferenceSku - - Specifies the VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet. - - String - - - ImageReferenceVersion - - Specifies the version of the VMImage. To use the latest version, specify a value of latest instead of a particular version. - - String - - - Name - - Specifies the name of the operating system disk. - - String - - - OsDiskCaching - - Specifies the caching mode of the operating system disk. The acceptable values for this parameter are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. If you change the caching value, the cmdlet will restart the virtual machine. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - - OsDiskCreateOption - - Specifies how this cmdlet creates the VMSS virtual machines. - The acceptable values for this parameter are: - -- Attach : This value is used when you are using a specialized disk to create the VMSS virtual machine. --- FromImage : This value is used when you are using an image to create the VMSS virtual machine. If you are using a platform image, you will also use the imageReference parameter. - - DiskCreateOptionTypes - - - OsDiskOsType - - Specifies the type of operating system on the disk. This is only needed for user image scenarios and not for a platform image. - - Nullable`1[OperatingSystemTypes] - - - Image - - Specifies the blob URI for the user image. VMSS creates an operating system disk in the same container of the user image. - - String - - - VhdContainer - - Specifies the container URLs that are used to store operating system disks for the VMSS. - - String[] - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VirtualMachineScaleSet - - Specifies the VMSS object. To obtain the object, use the New-AzureRmVmssConfig object. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - ImageReferencePublisher - - Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet. - - String - - String - - - none - - - ImageReferenceOffer - - Specifies the type of virtual machine image (VMImage) offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet. - - String - - String - - - none - - - ImageReferenceSku - - Specifies the VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet. - - String - - String - - - none - - - ImageReferenceVersion - - Specifies the version of the VMImage. To use the latest version, specify a value of latest instead of a particular version. - - String - - String - - - none - - - Name - - Specifies the name of the operating system disk. - - String - - String - - - none - - - OsDiskCaching - - Specifies the caching mode of the operating system disk. The acceptable values for this parameter are: - -- ReadOnly --- ReadWrite - The default value is ReadWrite. If you change the caching value, the cmdlet will restart the virtual machine. - This setting affects the consistency and performance of the disk. - - Nullable`1[CachingTypes] - - Nullable`1[CachingTypes] - - - none - - - OsDiskCreateOption - - Specifies how this cmdlet creates the VMSS virtual machines. - The acceptable values for this parameter are: - -- Attach : This value is used when you are using a specialized disk to create the VMSS virtual machine. --- FromImage : This value is used when you are using an image to create the VMSS virtual machine. If you are using a platform image, you will also use the imageReference parameter. - - DiskCreateOptionTypes - - DiskCreateOptionTypes - - - none - - - OsDiskOsType - - Specifies the type of operating system on the disk. This is only needed for user image scenarios and not for a platform image. - - Nullable`1[OperatingSystemTypes] - - Nullable`1[OperatingSystemTypes] - - - none - - - Image - - Specifies the blob URI for the user image. VMSS creates an operating system disk in the same container of the user image. - - String - - String - - - none - - - VhdContainer - - Specifies the container URLs that are used to store operating system disks for the VMSS. - - String[] - - String[] - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set the storage profile properties for the VMSS -------------------------- - - PS C:\> - - PS C:\>Set-AzureRmVmssStorageProfile -VirtualMachineScaleSet "ContosoVMSS" -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" ` +PS C:\> Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $RGname -VMName $VMName -AadClientID $AADClientID -AadClientCertThumbprint $AADClientCertThumbprint -DiskEncryptionKeyVaultUrl $DiskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId ; +This example enables encryption using Azure AD client ID, client cert thumbprint, and wrap disk encryption key by using key encryption key.Add-AzureRmVMSecretGet-AzureRmVMDiskEncryptionStatusRemove-AzureRmVMDiskEncryptionExtensionSet-AzureRmVMDscExtensionConfigures the DSC extension on a virtual machine.SetAzureRmVMDscExtensionThe Set-AzureRmVMDscExtension cmdlet configures the Windows PowerShell Desired State Configuration (DSC) extension on a virtual machine in a resource group.Set-AzureRmVMDscExtensionVersionSpecifies the version of the DSC extension that Set-AzureRmVMDscExtension applies the settings to.StringResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine where DSC extension handler is installed.StringArchiveStorageAccountNameSpecifies the Azure storage account name that is used to download the ArchiveBlobName.StringArchiveBlobNameSpecifies the name of the configuration file that was previously uploaded by the Publish-AzureRmVMDscConfiguration cmdlet.StringArchiveContainerNameSpecies name of the Azure storage container where the configuration archive is located.StringArchiveResourceGroupNameSpecifies the name of the resource group that contains the storage account that contains the configuration archive. This parameter is optional if the storage account and virtual machine are both in the same resource group. StringArchiveStorageEndpointSuffixSpecifies the storage endpoint suffix.StringAutoUpdateSpecifies the extension handler version specified by the Version parameter. By default extension handler is not autoupdated. Use the AutoUpdate parameter to enable auto update of the extension handler to the latest version as and when it is available.ConfigurationArgumentSpecifies a hash table that contains the arguments to the configuration function.HashtableConfigurationDataSpecifies the path of a .psd1 file that specifies the data for the configuration.StringConfigurationNameSpecifies the name of the configuration that the DSC Extension invokes.StringDataCollectionSpecifies the data collection type. The acceptable values for this parameter are: Enable and Disable.EnableDisableForceForces the command to run without asking for user confirmation.LocationSpecifies the path of the resource extension.StringNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The default value is Microsoft.Powershell.DSC.StringWmfVersionSpecifies the WMF version.4.05.05.1PPlatestConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ArchiveBlobNameSpecifies the name of the configuration file that was previously uploaded by the Publish-AzureRmVMDscConfiguration cmdlet.StringStringnoneArchiveContainerNameSpecies name of the Azure storage container where the configuration archive is located.StringStringnoneArchiveResourceGroupNameSpecifies the name of the resource group that contains the storage account that contains the configuration archive. This parameter is optional if the storage account and virtual machine are both in the same resource group. StringStringnoneArchiveStorageAccountNameSpecifies the Azure storage account name that is used to download the ArchiveBlobName.StringStringnoneArchiveStorageEndpointSuffixSpecifies the storage endpoint suffix.StringStringnoneAutoUpdateSpecifies the extension handler version specified by the Version parameter. By default extension handler is not autoupdated. Use the AutoUpdate parameter to enable auto update of the extension handler to the latest version as and when it is available.SwitchParameterSwitchParameternoneConfigurationArgumentSpecifies a hash table that contains the arguments to the configuration function.HashtableHashtablenoneConfigurationDataSpecifies the path of a .psd1 file that specifies the data for the configuration.StringStringnoneConfigurationNameSpecifies the name of the configuration that the DSC Extension invokes.StringStringnoneDataCollectionSpecifies the data collection type. The acceptable values for this parameter are: Enable and Disable.System.StringSystem.StringnoneForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneLocationSpecifies the path of the resource extension.StringStringnoneNameSpecifies the name of the Azure Resource Manager resource that represents the extension. The default value is Microsoft.Powershell.DSC.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVersionSpecifies the version of the DSC extension that Set-AzureRmVMDscExtension applies the settings to.StringStringnoneVMNameSpecifies the name of the virtual machine where DSC extension handler is installed.StringStringnoneWmfVersionSpecifies the WMF version.System.StringSystem.StringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Set a DSC extensionPS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM07" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -Version "1.10" -Location "West US" +This command sets the DSC extension on the virtual machine named VM07 to download Sample.ps1.zip from the storage account named Stg and the default container. The command invokes the configuration named ConfigName. The Sample.ps1.zip file was previously uploaded by using Publish-AzureRmVMDscConfiguration. Example 2: Set a DSC extension with configuration dataPS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM13" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName "WindowsPowerShellDSC" -ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US" +This command sets the extension on the virtual machine named VM13 to download Sample.ps1.zip from the storage account named Stg and the container named WindowsPowerShellDSC. The command the configuration named ConfigName and specifies configuration data and arguments. The Sample.ps1.zip file was previously uploaded by using Publish-AzureRmVMDscConfiguration. Example 3: Set a DSC extension with configuration data that has auto updatePS C:\>Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM22" -ArchiveBlobName "Sample.ps1.zip" -ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName WindowsPowerShellDSC -ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US" -AutoUpdate +This command sets the extension on the virtual machine named VM22 to download Sample.ps1.zip from the storage account named Stg and the container named WindowsPowerShellDSC. The command invokes the configuration named ConfigName and specifies configuration data and arguments. This command also enables auto update of extension handler to the latest version. The Sample.ps1.zip was previously uploaded by using Publish-AzureRmVMDscConfiguration.Get-AzureRmVMDscExtensionRemove-AzureRmVMDscExtensionPublish-AzureRmVMDscConfigurationSet-AzureRmVMExtensionUpdates extension properties or adds an extension to a virtual machine.SetAzureRmVMExtensionThe Set-AzureRmVMExtension cmdlet updates properties for existing Virtual Machine Extensions or adds an extension to a virtual machine.Set-AzureRmVMExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions.ForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of an extension. StringProtectedSettingsSpecifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration. HashtableSettingsSpecifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration. HashtableTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringExtensionTypeSpecifies the extension type.StringPublisherSpecifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Set-AzureRmVMExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. StringDisableAutoUpgradeMinorVersionIndicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions.ForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringLocationSpecifies the location of the virtual machine.StringNameSpecifies the name of an extension. StringProtectedSettingStringSpecifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.StringSettingStringSpecifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration.StringTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringExtensionTypeSpecifies the extension type.StringPublisherSpecifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension.StringConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.DisableAutoUpgradeMinorVersionIndicates that this cmdlet prevents the Azure guest agent from automatically updating the extensions to a newer minor version. By default, this cmdlet enables the guest agent to update the extensions.SwitchParameterSwitchParameternoneExtensionTypeSpecifies the extension type.StringStringnoneForceRerunIndicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.StringStringnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of an extension. StringStringnoneProtectedSettingsSpecifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration. HashtableHashtablenoneProtectedSettingStringSpecifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration.StringStringnonePublisherSpecifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneSettingsSpecifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration. HashtableHashtablenoneSettingStringSpecifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration.StringStringnoneTypeHandlerVersionSpecifies the version of the extension to use for this virtual machine.StringStringnoneVMNameSpecifies the name of a virtual machine. This cmdlet modifies extensions for the virtual machine that this parameter specifies. StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Modify settings by using hash tablesPS C:\>$Settings = @{"fileUris" = "[]"; "commandToExecute" = ""}; +PS C:\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey}; +PS C:\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "ContosoTest" -Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -Settings $Settings -ProtectedSettings $ProtectedSettings; +The first two commands use standard Windows PowerShell syntax to create hash tables, and then stores those hash tables in the $Settings and $ProtectedSettings variables. For more information, type Get-Help about_Hash_Tables. The second command includes two values previously created and stored in variables. The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of $Settings and $ProtectedSettings. The command specifies other required information that includes the publisher and the extension type.Example 2: Modify settings by using stringsPS C:\>$SettingsString = '{"fileUris":[],"commandToExecute":""}'; +PS C:\> $ProtectedSettingsString = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}'; +PS C:\> Set-AzureRmVMExtension -ResourceGroupName "ResourceGroup11" -Location "West US" -VMName "VirtualMachine22" -Name "CustomScriptExtension" -Publisher "Contoso.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion "1.1" -SettingString $SettingsString -ProtectedSettingString $ProtectedSettingsString ; +The first two commands create strings that contain settings, and then stores them in the $SettingsString and $ProtectedSettingsString variables. The final command modifies an extension of the virtual machine named VirtualMachine22 in ResourceGroup11 according to the contents of $SettingsString and $ProtectedSettingsString. The command specifies other required information that includes the publisher and the extension type.Get-AzureRmVMExtensionRemove-AzureRmVMExtensionSet-AzureRmVMOperatingSystemSets operating system properties for a virtual machine.SetAzureRmVMOperatingSystemThe Set-AzureRmVMOperatingSystem cmdlet sets operating system properties for a virtual machine. You can specify logon credentials, computer name, and operating system type.Set-AzureRmVMOperatingSystemVMSpecifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet.PSVirtualMachineWindowsIndicates that the type of operating system is Windows.ComputerNameSpecifies the name of the computer.StringCredentialSpecifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.PSCredentialCustomDataSpecifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.StringProvisionVMAgentIndicates that the settings require that the virtual machine agent be installed on the virtual machine.EnableAutoUpdateIndicates that this cmdlet enables auto update.TimeZoneSpecifies the time zone for the virtual machine.StringWinRMHttpIndicates that this operating system uses HTTP WinRM. Set-AzureRmVMOperatingSystemVMSpecifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet.PSVirtualMachineLinuxIndicates that the type of operating system is Linux.ComputerNameSpecifies the name of the computer.StringCredentialSpecifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.PSCredentialCustomDataSpecifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.StringDisablePasswordAuthenticationIndicates that this cmdlet disables password authentication.Set-AzureRmVMOperatingSystemWinRMHttpsIndicates that this operating system uses HTTPS WinRM.WinRMCertificateUrlSpecifies the URI of a WinRM certificate. This needs to be stored in a Key Vault.System.UriComputerNameSpecifies the name of the computer.StringStringnoneCredentialSpecifies the user name and password for the virtual machine as a PSCredential object. To obtain a credential, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.PSCredentialPSCredentialnoneCustomDataSpecifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.StringStringnoneDisablePasswordAuthenticationIndicates that this cmdlet disables password authentication.SwitchParameterSwitchParameternoneEnableAutoUpdateIndicates that this cmdlet enables auto update.SwitchParameterSwitchParameternoneLinuxIndicates that the type of operating system is Linux.SwitchParameterSwitchParameternoneProvisionVMAgentIndicates that the settings require that the virtual machine agent be installed on the virtual machine.SwitchParameterSwitchParameternoneTimeZoneSpecifies the time zone for the virtual machine.StringStringnoneVMSpecifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. Create a virtual machine object by using the New-AzureRmVMConfig cmdlet.PSVirtualMachinePSVirtualMachinenoneWindowsIndicates that the type of operating system is Windows.SwitchParameterSwitchParameternoneWinRMCertificateUrlSpecifies the URI of a WinRM certificate. This needs to be stored in a Key Vault.System.UriSystem.UrinoneWinRMHttpIndicates that this operating system uses HTTP WinRM. SwitchParameterSwitchParameternoneWinRMHttpsIndicates that this operating system uses HTTPS WinRM.SwitchParameterSwitchParameternoneExample 1: Set operating system properties for a new virtual machinesPS C:\>$SecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force +PS C:\> $Credential = New-Object System.Management.Automation.PSCredential ("FullerP", $SecurePassword); +PS C:\> $AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> $ComputerName = "ContosoVM122" +PS C:\> $WinRMCertUrl = "http://keyVaultName.vault.azure.net/secrets/secretName/secretVersion" +PS C:\> $TimeZone = "Pacific Standard Time" +PS C:\> $CustomData = "echo 'Hello World'" +PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $$VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -CustomData $CustomData -WinRMHttp -WinRMHttps -WinRMCertificateUrl $WinRMCertUrl -ProvisionVMAgent -EnableAutoUpdate -TimeZone $TimeZone +The first command converts a password to a secure string, and then stores it in the $SecurePassword variable. For more information, type Get-Help ConvertTo-SecureString. The second command creates a credential for the user FullerP and the password stored in $SecurePassword, and then stores the credential in the $Credential variable. For more information, type Get-Help New-Object. The third command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The fourth command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The next four commands assign values to variables to use in the following command. Because you could specify these strings directly in the Set-AzureRmVMOperatingSystem command, this approach is used only for readability. However, you might use an approach such as this in scripts. The final command sets operating system properties for the virtual machine stored in $VirtualMachine. The command uses the credentials stored in $Credential. The command uses variables assigned in previous commands for some parameters.Get-AzureRmVMNew-AzureRmVMConfigSet-AzureRmVMOSDiskSets the operating system disk properties on a virtual machine.SetAzureRmVMOSDiskThe Set-AzureRmVMOSDisk cmdlet set the operating system disk properties on a virtual machine.Set-AzureRmVMOSDiskVMSpecifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. PSVirtualMachineNameSpecifies the name of the operating system disk.StringVhdUriSpecifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD).For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. StringCachingSpecifies the caching mode of the operating system disk. Valid values are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. This setting affects the performance of the disk.CachingTypes]SourceImageUriSpecifies the URI of the VHD for user image scenarios.StringCreateOptionSpecifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: + +-- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. +-- FromImage. Specify this option to create a virtual machine from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. +-- Empty.FromImageEmptyAttachWindowsIndicates that the operating system on the user image is Windows. DiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]Set-AzureRmVMOSDiskVMSpecifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. PSVirtualMachineNameSpecifies the name of the operating system disk.StringVhdUriSpecifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD).For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. StringCachingSpecifies the caching mode of the operating system disk. Valid values are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. This setting affects the performance of the disk.CachingTypes]SourceImageUriSpecifies the URI of the VHD for user image scenarios.StringCreateOptionSpecifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: + +-- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. +-- FromImage. Specify this option to create a virtual machine from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. +-- Empty.FromImageEmptyAttachLinuxIndicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment.DiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]Set-AzureRmVMOSDiskKeyEncryptionKeyUrlSpecifies the location of the key encryption key.System.StringKeyEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the key encryption key.System.StringDiskEncryptionKeyUrlSpecifies the location of the disk encryption key.System.StringDiskEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the disk encryption key.System.StringDiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]Set-AzureRmVMOSDiskKeyEncryptionKeyUrlSpecifies the location of the key encryption key.System.StringKeyEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the key encryption key.System.StringDiskEncryptionKeyUrlSpecifies the location of the disk encryption key.System.StringDiskEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the disk encryption key.System.StringDiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]Set-AzureRmVMOSDiskDiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]CachingSpecifies the caching mode of the operating system disk. Valid values are: + +-- ReadOnly +-- ReadWrite + +The default value is ReadWrite. Changing the caching value causes the virtual machine to restart. This setting affects the performance of the disk.CachingTypes]CachingTypes]noneCreateOptionSpecifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, or attaches an existing disk. Valid values are: + +-- Attach. Specify this option to create a virtual machine from a specialized disk. When you specify this option, do not specify the SourceImageUri parameter. Instead, use the Set-AzureRmVMSourceImage cmdlet. You must also use the use the Windows or Linux parameters to tell the azure2 platform the type of the operating system on the VHD. The VhdUri parameter is enough to tell the azure2 platform the location of the disk to attach. +-- FromImage. Specify this option to create a virtual machine from a platform image or a generalized user image. In the case of a generalized user image, you also need to specify the SourceImageUri parameter and either the Windows or Linux parameters to tell the Azure platform the location and type of the operating system disk VHD instead of using the Set-AzureRmVMSourceImage cmdlet. In the case of a platform image, the VhdUri parameter is sufficient. +-- Empty.DiskCreateOptionTypesDiskCreateOptionTypesnoneDiskEncryptionKeyUrlSpecifies the location of the disk encryption key.System.StringSystem.StringnoneDiskEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the disk encryption key.System.StringSystem.StringnoneDiskSizeInGBSpecifies the size, in GB, of the operating system disk.Nullable [System.Int32]Nullable [System.Int32]noneKeyEncryptionKeyUrlSpecifies the location of the key encryption key.System.StringSystem.StringnoneKeyEncryptionKeyVaultIdSpecifies the resource ID of the Key Vault containing the key encryption key.System.StringSystem.StringnoneLinuxIndicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment.SwitchParameterSwitchParameternoneNameSpecifies the name of the operating system disk.StringStringnoneSourceImageUriSpecifies the URI of the VHD for user image scenarios.StringStringnoneVhdUriSpecifies the Uniform Resource Identifier (URI) of a virtual hard disk (VHD).For an image based virtual machine, this parameter specifies the VHD file to create when a platform image or user image is specified. This is the location from which the image binary large object (BLOB) is copied to start the virtual machine. For a disk based virtual machine boot scenario, this parameter specifies the VHD file that the virtual machine uses directly for starting up. StringStringnoneVMSpecifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. PSVirtualMachinePSVirtualMachinenoneWindowsIndicates that the operating system on the user image is Windows. SwitchParameterSwitchParameternoneExample 1: Set properties on a virtual machine from platform imagePS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "OsDisk12" -VhdUri "os.vhd" -Caching ReadWrite +PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName "MainComputer" -Credential (Get-Credential) +PS C:\> $VirtualMachine = Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName "Canonical" -Offer "UbuntuServer" -Skus "15.10" -Version "latest" -Caching ReadWrite +PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption FromImage +PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" + +The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine. Example 2: Sets properties on a virtual machine from generalized user imagePS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" +PS C:\> $VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName "MainComputer" -Credential (Get-Credential) +PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -SourceImageUri "https://mystorageaccount.blob.core.windows.net/vhds/myOSImage.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption fromImage -Linux +PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" + +The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11 and stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine.Example 3: Sets properties on a virtual machine from specialized user imagePS C:\>$AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet13" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" +PS C:\> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/" -CreateOption Attach -Linux +PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "ResourceGroup11" + +The first command gets the availability set named AvailablitySet13 in the resource group named ResourceGroup11 and stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object and stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets the properties on the virtual machine in $VirtualMachine. Example 4: Set the disk encryption settings on a virtual machine operating system diskPS C:\>$VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine17" -VMSize "Standard_A1" +PS C:> $VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name "OsDisk12" -VhdUri "os.vhd" -Caching ReadWrite -Windows -CreateOption "Attach" -DiskEncryptionKeyUrl "https://mytestvault.vault.azure.net/secrets/Test1/514ceb769c984379a7e0230bddaaaaaa" -DiskEncryptionKeyVaultId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.KeyVault/vaults/mytestvault" +PS C:> New-AzureRmVM -VM $VirtualMachine -ResouceGroupName " ResourceGroup11" +This example sets the disk encryption settings on a virtual machine operating system disk.Get-AzureRmVMGet-AzureRmAvailabilitySetNew-AzureRmVMConfigSet-AzureRmVMPlanSets the Marketplace plan information on a virtual machine.SetAzureRmVMPlanThe Set-AzureRmVMPlan cmdlet sets the Azure Marketplace plan information for a virtual machine. Before being able to deploy a Marketplace image through the command-line, programmatic access must be enabled or the virtual machine must be deployed by using the Azure portal. Set-AzureRmVMPlanVMSpecifies the virtual machine object for which to set a Marketplace plan. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object.PSVirtualMachineNameSpecifies the name of the image from the Marketplace. This is the same value that is returned by the Get-AzureRmVMImageSku cmdlet. For more information about how to find image information, see Navigating and Selecting Azure Virtual Machine images with PowerShell and the Azure CLI (https://azure.microsoft.com/documentation/articles/resource-groups-vm-searching/) in the Microsoft Azure documentation. StringProductSpecifies the product of the image from the Marketplace. This is the same information as the Offer value of the imageReference element.StringPromotionCodeSpecifies a promotion code. StringPublisherSpecifies the publisher of the image. You can find this information by using the Get-AzureRmVMImagePublisher cmdlet. StringNameSpecifies the name of the image from the Marketplace. This is the same value that is returned by the Get-AzureRmVMImageSku cmdlet. For more information about how to find image information, see Navigating and Selecting Azure Virtual Machine images with PowerShell and the Azure CLI (https://azure.microsoft.com/documentation/articles/resource-groups-vm-searching/) in the Microsoft Azure documentation. StringStringnoneProductSpecifies the product of the image from the Marketplace. This is the same information as the Offer value of the imageReference element.StringStringnonePromotionCodeSpecifies a promotion code. StringStringnonePublisherSpecifies the publisher of the image. You can find this information by using the Get-AzureRmVMImagePublisher cmdlet. StringStringnoneVMSpecifies the virtual machine object for which to set a Marketplace plan. You can use the Get-AzureRmVM cmdlet to obtain a virtual machine object. You can use the New-AzureRmVMConfig cmdlet to create a virtual machine object.PSVirtualMachinePSVirtualMachinenone 1: Get-AzureRmVMGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuNew-AzureRmVMConfigSet-AzureRmVMSourceImageSpecifies the platform image for a virtual machine.SetAzureRmVMSourceImageThe Set-AzureRmVMSourceImage cmdlet specifies the platform image to use for a virtual machine.Set-AzureRmVMSourceImageVMSpecifies the local virtual machine object to configure.PSVirtualMachinePublisherNameSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringOfferSpecifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringSkusSpecifies a VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet.StringVersionSpecifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. StringOfferSpecifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringStringnonePublisherNameSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringStringnoneSkusSpecifies a VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet.StringStringnoneVersionSpecifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. StringStringnoneVMSpecifies the local virtual machine object to configure.PSVirtualMachinePSVirtualMachinenoneExample 1: Set values for an imagePS C:\>AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Skus "2012-R2-Datacenter" -Version "latest" +The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable. The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet. The final command sets values for publisher name, offer, SKU, and version. The Get-AzureRmVMImagePublisher, Get-AzureRmVMImageOffer, Get-AzureRmVMImageSku, and Get-AzureRmVMImage cmdlets can discover these settings.Get-AzureRmAvailabilitySetGet-AzureRmVMImageGet-AzureRmVMImageOfferGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuNew-AzureRmVMConfigSet-AzureRMVMSqlServerExtensionSets the Azure SQL Server extension on a virtual machine.SetAzureRMVMSqlServerExtensionThe Set-AzureRmVMSqlServerExtension cmdlet sets the AzureSQL Server extension on a virtual machine.Set-AzureRMVMSqlServerExtensionVersionSpecifies the version of the SQL Server extension. StringResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringVMNameSpecifies the name of the virtual machine on which this cmdlet sets the SQL Server extension.StringNameSpecifies the name of the SQL Server the extension. StringAutoPatchingSettingsSpecifies the automatic SQL Server patching settings. To create an AutoPatchingSettings object , use the New-AzureVMSqlServerAutoPatchingConfig cmdlet. AutoPatchingSettingsAutoBackupSettingsSpecifies the automatic SQL Server backup settings. To create an AutoBackupSettings object , use the New-AzureVMSqlServerAutoBackupConfig cmdlet.AutoBackupSettingsKeyVaultCredentialSettingsMicrosoft.Azure.Commands.Compute.KeyVaultCredentialSettingsLocationSpecifies the location of the virtual machine.StringAutoBackupSettingsSpecifies the automatic SQL Server backup settings. To create an AutoBackupSettings object , use the New-AzureVMSqlServerAutoBackupConfig cmdlet.AutoBackupSettingsAutoBackupSettingsnoneAutoPatchingSettingsSpecifies the automatic SQL Server patching settings. To create an AutoPatchingSettings object , use the New-AzureVMSqlServerAutoPatchingConfig cmdlet. AutoPatchingSettingsAutoPatchingSettingsnoneKeyVaultCredentialSettingsMicrosoft.Azure.Commands.Compute.KeyVaultCredentialSettingsMicrosoft.Azure.Commands.Compute.KeyVaultCredentialSettingsnoneLocationSpecifies the location of the virtual machine.StringStringnoneNameSpecifies the name of the SQL Server the extension. StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneVersionSpecifies the version of the SQL Server extension. StringStringnoneVMNameSpecifies the name of the virtual machine on which this cmdlet sets the SQL Server extension.StringStringnoneExample 1: Set automatic patching settings on a virtual machinePS C:\>$AutoPatchingConfig = New-AzureVMSqlServerAutoPatchingConfig -Enable -DayOfWeek "Thursday" -MaintenanceWindowStartingHour 11 -MaintenanceWindowDuration 120 -PatchCategory "Important" +PS C:\> Get-AzureRmVM -ServiceName "Service02" -Name "VirtualMachine11" | Set-AzureRmVMSqlServerExtension -AutoPatchingSettings $AutoPatchingConfig | Update-AzureRmVM +The first command creates a configuration object by using the New-AzureVMSqlServerAutoPatchingConfig cmdlet. The command stores the configuration in the $AutoPatchingConfig variable. The second command gets the virtual machine named VirtualMachine11 on the service named Service02 by using the Get-AzureRmVM cmdlet. The command passes that object to the current cmdlet by using the pipeline operator. The current cmdlet sets the automatic patching settings in $AutoPatchingConfig for the virtual machine. The command passes the virtual machine to the Update-AzureRmVM cmdlet. Example 2: Set automatic backup settings on a virtual machinePS C:\>$AutoBackupConfig = New-AzureVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri $StorageUrl -StorageKey $StorageAccountKeySecure +PS C:\> Get-AzureRmVM -ServiceName "Service02" -Name "VirtualMachine11" | Set-AzureRmVMSqlServerExtension -AutoBackupSettings $AutoBackupConfig | Update-AzureRmVM +The first command creates a configuration object by using the New-AzureVMSqlServerAutoBackupConfig cmdlet. The command stores the configuration in the $AutoBackupConfig variable. The second command gets the virtual machine named VirtualMachine11 on the service named Service02, and then passes it to the current cmdlet. The current cmdlet sets the automatic backup settings in $AutoBackupConfig for the virtual machine. The command passes the virtual machine to the Update-AzureRmVM cmdlet. Example 3: Disable a SQL Server extension on a virtual machinePS C:\>Get-AzureRmVM -ServiceName "Service03" -Name "VirtualMachine08" | Set-AzureRmVMSqlServerExtension -Disable +This command gets a virtual machine named VirtualMachine08 on Service03, and then passes it to the current cmdlet. The command disables SQL Server virtual machine extension on that virtual machine.Example 4: Uninstall a SQL Server extension on a specific virtual machinePS C:\>Get-AzureRmVM -ServiceName "Service03" -Name "VirtualMachine08" | Set-AzureRmVMSqlServerExtension -Uninstall +This command gets a virtual machine named VirtualMachine08 on Service03, and then passes it to the current cmdlet. The command uninstalls a SQL Server virtual machine extension on that virtual machine. Get-AzureRmVMGet-AzureRmVMSqlServerExtensionNew-AzureVMSqlServerAutoPatchingConfigNew-AzureVMSqlServerAutoBackupConfigRemove-AzureRmVMSqlServerExtensionUpdate-AzureRmVMSet-AzureRmVmssOsProfileSets the VMSS operating system profile properties.SetAzureRmVmssOsProfileThe Set-AzureRmVmssOsProfile cmdlet sets the Virtual Machine Scale Set operating system profile properties.Set-AzureRmVmssOsProfileVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetListenerSpecifies the Windows Remote Management (WinRM) listeners. This enables remote Windows PowerShell®. You can use the Add-AzureRmVmssWinRMListener cmdlet to create the listener.WinRMListener[]LinuxConfigurationDisablePasswordAuthenticationIndicates that this cmdlet disables password authentication.Boolean]PublicKeySpecifies the Secure Shell (SSH) public key object. You can use the Add-AzureRmVMSshPublicKey cmdlet to create the object.SshPublicKey[]SecretSpecifies the secrets object which contains the certificate references to place on the virtual machine. You can use the Add-AzureRmVmssSecret cmdlet to create the secrets object.VaultSecretGroup[]ComputerNamePrefixSpecifies the computer name prefix for all the virtual machine instances in the VMSS. Computer names must be 1 to 15 characters long.StringAdminUsernameSpecifies the administrator account name to use for all the virtual machine instances in the VMSS.StringAdminPasswordSpecifies the administrator password to use for all the virtual machine instances in the VMSS.StringCustomDataSpecifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.StringWindowsConfigurationProvisionVMAgentIndicates whether virtual machine agent should be provisioned on the virtual machines in the VMSS.Boolean]WindowsConfigurationEnableAutomaticUpdateIndicates whether the virtual machines in the VMSS are enabled for automatic updates.Boolean]TimeZoneSpecifies the time zone for the virtual machine.StringAdditionalUnattendContentSpecifies an unattended content object. You can use the Add-AzureRmVMAdditionalUnattendContent to create the object.AdditionalUnattendContent[]AdditionalUnattendContentSpecifies an unattended content object. You can use the Add-AzureRmVMAdditionalUnattendContent to create the object.AdditionalUnattendContent[]AdditionalUnattendContent[]noneAdminPasswordSpecifies the administrator password to use for all the virtual machine instances in the VMSS.StringStringnoneAdminUsernameSpecifies the administrator account name to use for all the virtual machine instances in the VMSS.StringStringnoneComputerNamePrefixSpecifies the computer name prefix for all the virtual machine instances in the VMSS. Computer names must be 1 to 15 characters long.StringStringnoneCustomDataSpecifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.StringStringnoneLinuxConfigurationDisablePasswordAuthenticationIndicates that this cmdlet disables password authentication.Boolean]Boolean]noneListenerSpecifies the Windows Remote Management (WinRM) listeners. This enables remote Windows PowerShell®. You can use the Add-AzureRmVmssWinRMListener cmdlet to create the listener.WinRMListener[]WinRMListener[]nonePublicKeySpecifies the Secure Shell (SSH) public key object. You can use the Add-AzureRmVMSshPublicKey cmdlet to create the object.SshPublicKey[]SshPublicKey[]noneSecretSpecifies the secrets object which contains the certificate references to place on the virtual machine. You can use the Add-AzureRmVmssSecret cmdlet to create the secrets object.VaultSecretGroup[]VaultSecretGroup[]noneTimeZoneSpecifies the time zone for the virtual machine.StringStringnoneVirtualMachineScaleSetSpecifies the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.VirtualMachineScaleSetVirtualMachineScaleSetnoneWindowsConfigurationEnableAutomaticUpdateIndicates whether the virtual machines in the VMSS are enabled for automatic updates.Boolean]Boolean]noneWindowsConfigurationProvisionVMAgentIndicates whether virtual machine agent should be provisioned on the virtual machines in the VMSS.Boolean]Boolean]noneThis cmdlet does not generate any output.Example 1: Set the operating system profile properties for a VMSSPS C:\>Set-AzureRmVmssOSProfile -VirtualMachineScaleSet "ContosoVMSS" -ComputerNamePrefix "Test" -AdminUsername $AdminUsername -AdminPassword $AdminPassword +This command sets operating system profile properties for the virtual machines that belong to the VMSS named ContosoVMSS. The command sets the computer name prefix for all the virtual machine instances in the VMSS to Test and supplies the administrator username and password. Add-AzureRmVMAdditionalUnattendContentAdd-AzureRmVmssWinRMListenerAdd-AzureRmVMSshPublicKeyAdd-AzureRmVmssSecretNew-AzureRmVmssConfigSet-AzureRmVmssStorageProfileSets the storage profile properties for the VMSS.SetAzureRmVmssStorageProfileThe Set-AzureRmVmssStorageProfile cmdlet sets the storage profile properties for the Virtual Machine Scale Set (VMSS).Set-AzureRmVmssStorageProfileVirtualMachineScaleSetSpecifies the VMSS object. To obtain the object, use the New-AzureRmVmssConfig object.VirtualMachineScaleSetImageSpecifies the blob URI for the user image. VMSS creates an operating system disk in the same container of the user image.StringVhdContainerSpecifies the container URLs that are used to store operating system disks for the VMSS.String[]ImageReferencePublisherSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringImageReferenceOfferSpecifies the type of virtual machine image (VMImage) offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringImageReferenceSkuSpecifies the VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet.StringImageReferenceVersionSpecifies the version of the VMImage. To use the latest version, specify a value of latest instead of a particular version.StringNameSpecifies the name of the operating system disk.StringOsDiskCachingSpecifies the caching mode of the operating system disk. The acceptable values for this parameter are:-- ReadOnly +-- ReadWriteThe default value is ReadWrite. If you change the caching value, the cmdlet will restart the virtual machine. This setting affects the consistency and performance of the disk.CachingTypes]OsDiskCreateOptionSpecifies how this cmdlet creates the VMSS virtual machines.The acceptable values for this parameter are: + +-- Attach : This value is used when you are using a specialized disk to create the VMSS virtual machine. +-- FromImage : This value is used when you are using an image to create the VMSS virtual machine. If you are using a platform image, you will also use the imageReference parameter.FromImageEmptyAttachOsDiskOsTypeSpecifies the type of operating system on the disk. This is only needed for user image scenarios and not for a platform image.OperatingSystemTypes]ImageSpecifies the blob URI for the user image. VMSS creates an operating system disk in the same container of the user image.StringStringnoneImageReferenceOfferSpecifies the type of virtual machine image (VMImage) offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.StringStringnoneImageReferencePublisherSpecifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.StringStringnoneImageReferenceSkuSpecifies the VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet.StringStringnoneImageReferenceVersionSpecifies the version of the VMImage. To use the latest version, specify a value of latest instead of a particular version.StringStringnoneNameSpecifies the name of the operating system disk.StringStringnoneOsDiskCachingSpecifies the caching mode of the operating system disk. The acceptable values for this parameter are:-- ReadOnly +-- ReadWriteThe default value is ReadWrite. If you change the caching value, the cmdlet will restart the virtual machine. This setting affects the consistency and performance of the disk.CachingTypes]CachingTypes]noneOsDiskCreateOptionSpecifies how this cmdlet creates the VMSS virtual machines.The acceptable values for this parameter are: + +-- Attach : This value is used when you are using a specialized disk to create the VMSS virtual machine. +-- FromImage : This value is used when you are using an image to create the VMSS virtual machine. If you are using a platform image, you will also use the imageReference parameter.DiskCreateOptionTypesDiskCreateOptionTypesnoneOsDiskOsTypeSpecifies the type of operating system on the disk. This is only needed for user image scenarios and not for a platform image.OperatingSystemTypes]OperatingSystemTypes]noneVhdContainerSpecifies the container URLs that are used to store operating system disks for the VMSS.String[]String[]noneVirtualMachineScaleSetSpecifies the VMSS object. To obtain the object, use the New-AzureRmVmssConfig object.VirtualMachineScaleSetVirtualMachineScaleSetnoneThis cmdlet does not generate any output.Example 1: Set the storage profile properties for the VMSSPS C:\>Set-AzureRmVmssStorageProfile -VirtualMachineScaleSet "ContosoVMSS" -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" ` -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version ` - -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VhdContainer - - This example sets the storage profile properties for the VMSS. - - - - - - - - - - - - - - - - Get-AzureRmVMImageOffer - - - - Get-AzureRmVMImagePublisher - - - - Get-AzureRmVMImageSku - - - - New-AzureRmVmssConfig - - - - - - - - Set-AzureRmVmssVM - - Update the state of a VM Scale Set instance - - - - - Set - AzureRmVmssVM - - - - This cmdlet allows you to change the state of a specific VM Scale Set instance - - - - Set-AzureRmVmssVM - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Resource Group name of the VM Scale Set - - String - - - VMScaleSetName - - Name of the VM Scale Set - - String - - - InstanceId - - Instance ID of the VM Scale Set instance to change the state of - - String - - - Reimage - - Specifies that the selected Instance should be reimaged - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group name of the VM Scale Set - - String - - String - - - none - - - VMScaleSetName - - Name of the VM Scale Set - - String - - String - - - none - - - InstanceId - - Instance ID of the VM Scale Set instance to change the state of - - String - - String - - - none - - - Reimage - - Specifies that the selected Instance should be reimaged - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- 1: -------------------------- - - PS C:\> - - PS C:\> - - - - - - - - - - - - - - - - - - - - - - Start-AzureRmVM - - Starts an Azure virtual machine. - - - - - Start - AzureRmVM - - - - The Start-AzureRmVM cmdlet starts an Azure virtual machine. - - - - Start-AzureRmVM - - Name - - Specifies the name of the virtual machine to start. - - String - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Start-AzureRmVM - - Name - - Specifies the name of the virtual machine to start. - - String - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Name - - Specifies the name of the virtual machine to start. - - String - - String - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Start a virtual machine -------------------------- - - PS C:\> - - PS C:\>Start-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" - - This command starts the virtual machine named VirtualMachine07 in ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVM - - - - Remove-AzureRmVM - - - - Restart-AzureRmVM - - - - Stop-AzureRmVM - - - - Update-AzureRmVM - - - - - - - - Start-AzureRmVmss - - Starts the VMSS or a set of virtual machines within the VMSS. - - - - - Start - AzureRmVmss - - - - The Start-AzureRmVmss cmdlet starts all the virtual machines within the Virtual Machine Scale Set (VMSS) or a set of virtual machines. You can use the InstanceId parameter to select a set of virtual machines. - - - - Start-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Specifies the name of the VMSS that this cmdlet starts the virtual machines. - - String - - - InstanceId - - Specifies, as a string array, the ID or IDs of the instances that cmdlet starts. For instance: -InstanceId "0", "3" - - String[] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Specifies the name of the VMSS that this cmdlet starts the virtual machines. - - String - - String - - - none - - - InstanceId - - Specifies, as a string array, the ID or IDs of the instances that cmdlet starts. For instance: -InstanceId "0", "3" - - String[] - - String[] - - - none - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Start a specific set of virtual machines within the VMSS -------------------------- - - PS C:\> - - PS C:\>Start-AzureRmVmss -ResourceGroupName "ContosOrg" -VMScaleSetName "ContosoVMSS"-InstanceId "0", "1" - - This command starts a specific set of virtual machines specified by the instance ID string array that belong to the VMSS named ContosoVMSS. - - - - - - - - - - - - - - -------------------------- Example 2: Start all virtual machines within the VMSS -------------------------- - - PS C:\> - - PS C:\>Start-AzureRmVmss -ResourceGroupName "ContosOrg" -VMScaleSetName "ContosoVMSS" - - This command starts all virtual machines that belong to the VMSS named ContosoVMSS. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Set-AzureRmVmss - - - - Stop-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Stop-AzureRmVM - - Stops an Azure virtual machine. - - - - - Stop - AzureRmVM - - - - The Stop-AzureRmVM cmdlet stops an Azure virtual machine. - - - - Stop-AzureRmVM - - Name - - Specifies the name of the virtual machine to stop. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - StayProvisioned - - Indicates that this cmdlet uses the stay provisioned setting. - - SwitchParameter - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - Stop-AzureRmVM - - Name - - Specifies the name of the virtual machine to stop. - - String - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - - StayProvisioned - - Indicates that this cmdlet uses the stay provisioned setting. - - SwitchParameter - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - WhatIf - - - - SwitchParameter - - - Confirm - - - - SwitchParameter - - - - - - Name - - Specifies the name of the virtual machine to stop. - - String - - String - - - none - - - Force - - Forces the command to run without asking for user confirmation. - - SwitchParameter - - SwitchParameter - - - none - - - StayProvisioned - - Indicates that this cmdlet uses the stay provisioned setting. - - SwitchParameter - - SwitchParameter - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - WhatIf - - - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - - - SwitchParameter - - SwitchParameter - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Stop a virtual machine -------------------------- - - PS C:\> - - PS C:\>Stop-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" - - This command stops the virtual machine named VirtualMachine07 in ResourceGroup11. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVM - - - - Remove-AzureRmVM - - - - Restart-AzureRmVM - - - - Start-AzureRmVM - - - - Update-AzureRmVM - - - - - - - - Stop-AzureRmVmss - - Stops the VMSS or a set of virtual machines within the VMSS. - - - - - Stop - AzureRmVmss - - - - The Stop-AzureRmVmss cmdlet stops all the virtual machines within the Virtual Machine Scale Set (VMSS) or a set of virtual machines. You can use the InstanceId parameter to select a set of virtual machines. - - - - Stop-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Specifies the name of the VMSS for which this cmdlet stops the virtual machines. - - String - - - InstanceId - - Specifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3". - - String[] - - - - Stop-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Specifies the name of the VMSS for which this cmdlet stops the virtual machines. - - String - - - InstanceId - - Specifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3". - - String[] - - - StayProvisioned - - Indicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. - - SwitchParameter - - - - Stop-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - StayProvisioned - - Indicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. - - SwitchParameter - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Specifies the name of the VMSS for which this cmdlet stops the virtual machines. - - String - - String - - - none - - - InstanceId - - Specifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3". - - String[] - - String[] - - - none - - - StayProvisioned - - Indicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. - - SwitchParameter - - SwitchParameter - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Stop all the virtual machines within the VMSS -------------------------- - - PS C:\> - - PS C:\>Stop-AzureRmVmss -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" - - This command stops all virtual machines that belong to the VMSS named ContosoVMSS. - - - - - - - - - - - - - - -------------------------- Example 2: Stop a specific set of virtual machines within the VMSS -------------------------- - - PS C:\> - - PS C:\>Stop-AzureRmVmss -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" -InstanceId "3","5" - - This command stops a specific set of virtual machines specified by the instance ID string array that belong to the VMSS named ContosoVMSS. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Set-AzureRmVmss - - - - Start-AzureRmVmss - - - - Update-AzureRmVmss - - - - - - - - Test-AzureRmVMAEMExtension - - Checks the configuration of the AEM extension. - - - - - Test - AzureRmVMAEMExtension - - - - The Test-AzureRmVMAEMExtension cmdlet checks the configuration of the Azure Enhanced Monitoring (AEM) extension. The AEM extension collects the performance data. This cmdlet checks whether performance data is available. - - - - Test-AzureRmVMAEMExtension - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine that this cmdlet checks. - - String - - - VMName - - Specifies the name of a virtual machine. This cmdlet tests the AEM extension for the virtual machine that this parameter specifies. - - String - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - - WaitTimeInMinutes - - Specifies a time-out period, in minutes, for the storage configuration check. - - Int32 - - - SkipStorageCheck - - Indicates that this cmdlet skips the check of storage configuration. - - SwitchParameter - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine that this cmdlet checks. - - String - - String - - - none - - - VMName - - Specifies the name of a virtual machine. This cmdlet tests the AEM extension for the virtual machine that this parameter specifies. - - String - - String - - - none - - - OSType - - Specifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. - - String - - String - - - none - - - WaitTimeInMinutes - - Specifies a time-out period, in minutes, for the storage configuration check. - - Int32 - - Int32 - - - none - - - SkipStorageCheck - - Indicates that this cmdlet skips the check of storage configuration. - - SwitchParameter - - SwitchParameter - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Check the configuration of the AEM extension -------------------------- - - PS C:\> - - PS C:\>Test-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" - - This command checks the configuration of the AEM extension for the virtual machine named contoso-server. - - - - - - - - - - - - - - - - Get-AzureRmVMAEMExtension - - - - Remove-AzureRmVMAEMExtension - - - - Set-AzureRmVMAEMExtension - - - - - - - - Update-AzureRmContainerService - - Update the Container Service state - - - - - Update - AzureRmContainerService - - - - Update the Container Service state to match the state of the local Container Service object - - - - Update-AzureRmContainerService - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Resource Group of the Container Service to update - - String - - - Name - - Name of the Container Service to update - - String - - - ContainerService - - Local Container Service object with the updated state - - ContainerService - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group of the Container Service to update - - String - - String - - - - - - Name - - Name of the Container Service to update - - String - - String - - - - - - ContainerService - - Local Container Service object with the updated state - - ContainerService - - ContainerService - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureRmContainerService -ResourceGroupName $rgname -Name $csName ` -| Remove-AzureRmContainerServiceAgentPoolProfile -Name $agentPoolProfileName ` -| Add-AzureRmContainerServiceAgentPoolProfile -Name $agentPoolProfileName ` - -VmSize $vmSize ` - -DnsPrefix $agentPoolDnsPrefixName ` - -Count 2 ` -| Update-AzureRmContainerService -ResourceGroupName $rgname -Name $csName; - - - - - - - - - - - - - - - - - - - - - - Update-AzureRmVM - - Updates the state of an Azure virtual machine. - - - - - Update - AzureRmVM - - - - The Update-AzureRmVM cmdlet updates the state of an Azure virtual machine to the state of a virtual machine object. - - - - Update-AzureRmVM - - VM - - Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. - - PSVirtualMachine - - - Tags - - Specifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags. - - Hashtable - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Update-AzureRmVM - - VM - - Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. - - PSVirtualMachine - - - Tags - - Specifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags. - - Hashtable - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. - - PSVirtualMachine - - PSVirtualMachine - - - none - - - Tags - - Specifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags. - - Hashtable - - Hashtable[] - - - none - - - ResourceGroupName - - Specifies the name of the resource group of the virtual machine. - - String - - String - - - none - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Id - - Specifies the Resource ID of the virtual machine. - - String - - String - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Update a virtual machine -------------------------- - - PS C:\> - - PS C:\>Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine - - This command updates the virtual machine named VirtualMachine07 in ResourceGroup11. The command updates it by using another virtual machine object, stored in the $VirtualMachine variable. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. - - - - - - - - - - - - - - - - Get-AzureRmVM - - - - New-AzureRmVM - - - - Remove-AzureRmVM - - - - Restart-AzureRmVM - - - - Start-AzureRmVM - - - - Stop-AzureRmVM - - - - New-AzureRmVMConfig - - - - - - - - Update-AzureRmVmss - - Updates the state of a VMSS. - - - - - Update - AzureRmVmss - - - - The Update-AzureRmVmss cmdlet updates the state of a Virtual Machine Scale Set (VMSS) to the state of a local VMSS object. - - - - Update-AzureRmVmss - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group the VMSS belongs to. - - String - - - Name - - Specifies the name of the VMSS that this cmdlet updates the state for. - - String - - - VirtualMachineScaleSet - - Specifies a local VMSS object. To obtain a VMSS object, use the Get-AzureRmVmss cmdlet. This virtual machine object contains the updated state for the VMSS. - - VirtualMachineScaleSet - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group the VMSS belongs to. - - String - - String - - - none - - - Name - - Specifies the name of the VMSS that this cmdlet updates the state for. - - String - - String - - - none - - - VirtualMachineScaleSet - - Specifies a local VMSS object. To obtain a VMSS object, use the Get-AzureRmVmss cmdlet. This virtual machine object contains the updated state for the VMSS. - - VirtualMachineScaleSet - - VirtualMachineScaleSet - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Update the state of a VMSS to the state of a local VMSS object. -------------------------- - - PS C:\> - - PS C:\>Update-AzureRmVmss -ResourceGroupName "Group001" -Name "VMSS001" -VirtualMachineScaleSet "LocalVMSS" - - This command updates the state of the VMSS named VMSS001 that belongs to the resource group named Group001 to the state of a local VMSS object named LocalVMSS. - - - - - - - - - - - - - - - - Get-AzureRmVmss - - - - New-AzureRmVmss - - - - Remove-AzureRmVmss - - - - Restart-AzureRmVmss - - - - Set-AzureRmVmss - - - - Start-AzureRmVmss - - - - Stop-AzureRmVmss - - - - - - - - Update-AzureRmVmssInstance - - Starts a manual upgrade of the VMSS instance. - - - - - Update - AzureRmVmssInstance - - - - The Update-AzureRmVmssInstance cmdlet starts a manual upgrade of the specified Virtual Machine Scale Set (VMSS) instance. This is used when the upgrade policy on the VMSS Scale Set is set to manual. - - - - Update-AzureRmVmssInstance - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - - VMScaleSetName - - Specifies the name of the VMSS instance that this cmdlet upgrades. - - String - - - InstanceId - - Specifies, as a string array, the ID or IDs of the instance to upgrade. - - String[] - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Specifies the name of the resource group of the VMSS. - - String - - String - - - none - - - VMScaleSetName - - Specifies the name of the VMSS instance that this cmdlet upgrades. - - String - - String - - - none - - - InstanceId - - Specifies, as a string array, the ID or IDs of the instance to upgrade. - - String[] - - String[] - - - none - - - - - - - - - - - - - - - - - - - - - - - - This cmdlet does not generate any output. - - - - - - - - - - - - - - -------------------------- Example 1: Start an upgrade of the VMSS instance -------------------------- - - PS C:\> - - PS C:\>Update-AzureRmVmssInstance -ResourceGroupName "Group011" -VMScaleSetName "VMScaleSet001" -InstanceId "0" - - This command starts an upgrade of the VMSS named VMScaleSet001 that has the instance ID of 0. - - - - - - - - - - - - - - - - Update-AzureRmVmss - - - - - \ No newline at end of file + -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VhdContainer +This command sets the storage profile properties for the VMSS named ContosoVMSS.Get-AzureRmVMImageOfferGet-AzureRmVMImagePublisherGet-AzureRmVMImageSkuNew-AzureRmVmssConfigSet-AzureRmVmssVMModifies the state of a VMSS instance.SetAzureRmVmssVMThe Set-AzureRmVmssVM cmdlet modifies the state of a Virtual Machine Scale Set (VMSS) instance.Set-AzureRmVmssVMResourceGroupNameSpecifies the name of the resource group that contains the VMSS instance. StringVMScaleSetNameSpecifies the name of the VMSS instance that this cmdlet modifies. StringInstanceIdSpecifies the ID of the VMSS instance for which this cmdlet modifies state. StringReimageIndicates that this cmdlet reimages the VMSS instance. InstanceIdSpecifies the ID of the VMSS instance for which this cmdlet modifies state. StringStringnoneReimageIndicates that this cmdlet reimages the VMSS instance. SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group that contains the VMSS instance. StringStringnoneVMScaleSetNameSpecifies the name of the VMSS instance that this cmdlet modifies. StringStringnone 1: Get-AzureRmVmssVMSet-AzureRmVmssSets specific actions on a specified VMSS.SetAzureRmVmssThe Set-AzureRmVmss cmdlet sets specific actions on the Virtual Machine Scale Set (VMSS). The only action this cmdlet supports is Reimage.Set-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecies the name of the VMSS for which this cmdlet sets actions on.StringReimageIndicates that the cmdlet reimages the VMSS. ReimageIndicates that the cmdlet reimages the VMSS. SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVMScaleSetNameSpecies the name of the VMSS for which this cmdlet sets actions on.StringStringnoneThis cmdlet does not generate any output.Example 1: Reimage a VMSSPS C:\>Set-AzureRmVmss -Reimage -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" +This command reimages the VMSS named ContosoVMSS that belongs to the resource group named ContosoGroup.Get-AzureRmVmssNew-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssSet-AzureRmVMMarks a virtual machine as generalized.SetAzureRmVMThe Set-AzureRmVM cmdlet marks a virtual machine as generalized. Before you run this cmdlet, log on to the virtual machine and use Sysprep to prepare the hard disk. Set-AzureRmVMResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine on which this cmdlet operates.StringGeneralizedIndicates that this cmdlet marks a virtual machine as generalized.RedeployIndicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data.Set-AzureRmVMIdSpecifies the Resource ID of the virtual machine.StringNameSpecifies the name of the virtual machine on which this cmdlet operates.StringGeneralizedIndicates that this cmdlet marks a virtual machine as generalized.RedeployIndicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data.GeneralizedIndicates that this cmdlet marks a virtual machine as generalized.SwitchParameterSwitchParameternoneIdSpecifies the Resource ID of the virtual machine.StringStringnoneNameSpecifies the name of the virtual machine on which this cmdlet operates.StringStringnoneRedeployIndicates that this cmdlet manually redeploys the virtual machine to a different Azure host to fix any problems. If you redeploy a virtual machine, it restarts, which results in the loss of ephemeral drive data.SwitchParameterSwitchParameternoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneExample 1: Mark a virtual machine as generalizedPS C:\>Set-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized +This command marks the virtual machine named VirtualMachine07 as generalized.Get-AzureRmVMStart-AzureRmVmssStarts the VMSS or a set of virtual machines within the VMSS.StartAzureRmVmssThe Start-AzureRmVmss cmdlet starts all the virtual machines within the Virtual Machine Scale Set (VMSS) or a set of virtual machines. You can use the InstanceId parameter to select a set of virtual machines.Start-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecifies the name of the VMSS that this cmdlet starts the virtual machines.StringInstanceIdSpecifies, as a string array, the ID or IDs of the instances that cmdlet starts. For instance: -InstanceId "0", "3"String[]InstanceIdSpecifies, as a string array, the ID or IDs of the instances that cmdlet starts. For instance: -InstanceId "0", "3"String[]String[]noneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVMScaleSetNameSpecifies the name of the VMSS that this cmdlet starts the virtual machines.StringStringnoneThis cmdlet does not generate any output.Example 1: Start a specific set of virtual machines within the VMSS PS C:\>Start-AzureRmVmss -ResourceGroupName "ContosOrg" -VMScaleSetName "ContosoVMSS"-InstanceId "0", "1" +This command starts a specific set of virtual machines specified by the instance ID string array that belong to the VMSS named ContosoVMSS.Example 2: Start all virtual machines within the VMSSPS C:\>Start-AzureRmVmss -ResourceGroupName "ContosOrg" -VMScaleSetName "ContosoVMSS" +This command starts all virtual machines that belong to the VMSS named ContosoVMSS.Get-AzureRmVmssNew-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVmssStart-AzureRmVMStarts an Azure virtual machine.StartAzureRmVMThe Start-AzureRmVM cmdlet starts an Azure virtual machine.Start-AzureRmVMIdSpecifies the Resource ID of the virtual machine.StringNameSpecifies the name of the virtual machine to start.StringStart-AzureRmVMResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine to start.StringIdSpecifies the Resource ID of the virtual machine.StringStringnoneNameSpecifies the name of the virtual machine to start.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneExample 1: Start a virtual machinePS C:\>Start-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +This command starts the virtual machine named VirtualMachine07 in ResourceGroup11.Get-AzureRmVMNew-AzureRmVMRemove-AzureRmVMRestart-AzureRmVMStop-AzureRmVMUpdate-AzureRmVMStop-AzureRmVmssStops the VMSS or a set of virtual machines within the VMSS.StopAzureRmVmssThe Stop-AzureRmVmss cmdlet stops all the virtual machines within the Virtual Machine Scale Set (VMSS) or a set of virtual machines. You can use the InstanceId parameter to select a set of virtual machines. Stop-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecifies the name of the VMSS for which this cmdlet stops the virtual machines.StringInstanceIdSpecifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3".String[]Stop-AzureRmVmssResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecifies the name of the VMSS for which this cmdlet stops the virtual machines.StringInstanceIdSpecifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3".String[]StayProvisionedIndicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. Stop-AzureRmVmssStayProvisionedIndicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. InstanceIdSpecifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: -InstanceId "0", "3".String[]String[]noneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneStayProvisionedIndicates that this cmdlet deallocates all the virtual machines within the VMSS so that the user is not charged for the stopped virtual machines. SwitchParameterSwitchParameternoneVMScaleSetNameSpecifies the name of the VMSS for which this cmdlet stops the virtual machines.StringStringnoneExample 1: Stop all the virtual machines within the VMSSPS C:\>Stop-AzureRmVmss -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" +This command stops all virtual machines that belong to the VMSS named ContosoVMSS.Example 2: Stop a specific set of virtual machines within the VMSS PS C:\>Stop-AzureRmVmss -ResourceGroupName "ContosoGroup" -VMScaleSetName "ContosoVMSS" -InstanceId "3","5" +This command stops a specific set of virtual machines specified by the instance ID string array that belong to the VMSS named ContosoVMSS.Get-AzureRmVmssNew-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssUpdate-AzureRmVmssStop-AzureRmVMStops an Azure virtual machine.StopAzureRmVMThe Stop-AzureRmVM cmdlet stops an Azure virtual machine.Stop-AzureRmVMResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringNameSpecifies the name of the virtual machine to stop.StringForceForces the command to run without asking for user confirmation.StayProvisionedIndicates that this cmdlet uses the stay provisioned setting.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Stop-AzureRmVMIdSpecifies the Resource ID of the virtual machine.StringNameSpecifies the name of the virtual machine to stop.StringForceForces the command to run without asking for user confirmation.StayProvisionedIndicates that this cmdlet uses the stay provisioned setting.ConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ForceForces the command to run without asking for user confirmation.SwitchParameterSwitchParameternoneIdSpecifies the Resource ID of the virtual machine.StringStringnoneNameSpecifies the name of the virtual machine to stop.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneStayProvisionedIndicates that this cmdlet uses the stay provisioned setting.SwitchParameterSwitchParameternoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Stop a virtual machinePS C:\>Stop-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +This command stops the virtual machine named VirtualMachine07 in ResourceGroup11.Get-AzureRmVMNew-AzureRmVMRemove-AzureRmVMRestart-AzureRmVMStart-AzureRmVMUpdate-AzureRmVMTest-AzureRmVMAEMExtensionChecks the configuration of the AEM extension.TestAzureRmVMAEMExtensionThe Test-AzureRmVMAEMExtension cmdlet checks the configuration of the Azure Enhanced Monitoring (AEM) extension. The AEM extension collects the performance data. This cmdlet checks whether performance data is available.Test-AzureRmVMAEMExtensionResourceGroupNameSpecifies the name of the resource group of the virtual machine that this cmdlet checks.StringVMNameSpecifies the name of a virtual machine. This cmdlet tests the AEM extension for the virtual machine that this parameter specifies.StringOSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. StringWaitTimeInMinutesSpecifies a time-out period, in minutes, for the storage configuration check.Int32SkipStorageCheckIndicates that this cmdlet skips the check of storage configuration. OSTypeSpecifies the type of the operating system of the operating system disk. If the operating system disk does not have a type, you must specify this parameter. The acceptable values for this parameter are: Windows and Linux. StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine that this cmdlet checks.StringStringnoneSkipStorageCheckIndicates that this cmdlet skips the check of storage configuration. SwitchParameterSwitchParameternoneVMNameSpecifies the name of a virtual machine. This cmdlet tests the AEM extension for the virtual machine that this parameter specifies.StringStringnoneWaitTimeInMinutesSpecifies a time-out period, in minutes, for the storage configuration check.Int32Int32noneExample 1: Check the configuration of the AEM extensionPS C:\>Test-AzureRmVMAEMExtension -ResourceGroupName "ResourceGroup11" -VMName "contoso-server" +This command checks the configuration of the AEM extension for the virtual machine named contoso-server.Get-AzureRmVMAEMExtensionRemove-AzureRmVMAEMExtensionSet-AzureRmVMAEMExtensionUpdate-AzureRmContainerServiceUpdates the state of a container service.UpdateAzureRmContainerServiceThe Update-AzureRmContainerService cmdlet updates the state of a container service to match a local instance of the service. Update-AzureRmContainerServiceResourceGroupNameSpecifies the resource group of the container service that this cmdlet updates.StringNameSpecifies the name of the container service that this cmdlet updates.StringContainerServiceSpecifies a local ContainerService object that contains changes.ContainerServiceConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.ContainerServiceSpecifies a local ContainerService object that contains changes.ContainerServiceContainerServicenoneNameSpecifies the name of the container service that this cmdlet updates.StringStringnoneResourceGroupNameSpecifies the resource group of the container service that this cmdlet updates.StringStringnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Update a container servicePS C:\>Get-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" | Remove-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" | Add-AzureRmContainerServiceAgentPoolProfile -Name "AgentPool01" -VmSize "Standard_A1" -DnsPrefix "APResourceGroup17" -Count 2 | Update-AzureRmContainerService -ResourceGroupName "ResourceGroup17" -Name "CSResourceGroup17" +This command gets the container service named CSResourceGroup17 by using the Get-AzureRmContainerService cmdlet. The command passes that object to the Remove-AzureRmContainerServiceAgentPoolProfile cmdlet by using the pipeline operator. Remove-AzureRmContainerServiceAgentPoolProfile removes the profile named AgentPool01. The command passes the result to the Add-AzureRmContainerServiceAgentPoolProfile cmdlet.Add-AzureRmContainerServiceAgentPoolProfile adds a profile that has the name AgentPool01, and has the specified properties. The command passes the result to the current cmdlet. The current cmdlet updates the container service to reflect the changes that were made in this command. Add-AzureRmContainerServiceAgentPoolProfileGet-AzureRmContainerServiceNew-AzureRmContainerServiceRemove-AzureRmContainerServiceRemove-AzureRmContainerServiceAgentPoolProfileUpdate-AzureRmVmssInstanceStarts a manual upgrade of the VMSS instance.UpdateAzureRmVmssInstanceThe Update-AzureRmVmssInstance cmdlet starts a manual upgrade of the specified Virtual Machine Scale Set (VMSS) instance. This is used when the upgrade policy on the VMSS Scale Set is set to manual.Update-AzureRmVmssInstanceResourceGroupNameSpecifies the name of the resource group of the VMSS.StringVMScaleSetNameSpecifies the name of the VMSS instance that this cmdlet upgrades.StringInstanceIdSpecifies, as a string array, the ID or IDs of the instance to upgrade.String[]InstanceIdSpecifies, as a string array, the ID or IDs of the instance to upgrade.String[]String[]noneResourceGroupNameSpecifies the name of the resource group of the VMSS.StringStringnoneVMScaleSetNameSpecifies the name of the VMSS instance that this cmdlet upgrades.StringStringnoneThis cmdlet does not generate any output.Example 1: Start an upgrade of the VMSS instancePS C:\>Update-AzureRmVmssInstance -ResourceGroupName "Group011" -VMScaleSetName "VMScaleSet001" -InstanceId "0" +This command starts an upgrade of the VMSS named VMScaleSet001 that has the instance ID of 0.Update-AzureRmVmssUpdate-AzureRmVmssUpdates the state of a VMSS.UpdateAzureRmVmssThe Update-AzureRmVmss cmdlet updates the state of a Virtual Machine Scale Set (VMSS) to the state of a local VMSS object.Update-AzureRmVmssResourceGroupNameSpecifies the name of the resource group the VMSS belongs to.StringNameSpecifies the name of the VMSS that this cmdlet updates the state for.StringVirtualMachineScaleSetSpecifies a local VMSS object. To obtain a VMSS object, use the Get-AzureRmVmss cmdlet. This virtual machine object contains the updated state for the VMSS.VirtualMachineScaleSetConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.NameSpecifies the name of the VMSS that this cmdlet updates the state for.StringStringnoneResourceGroupNameSpecifies the name of the resource group the VMSS belongs to.StringStringnoneVirtualMachineScaleSetSpecifies a local VMSS object. To obtain a VMSS object, use the Get-AzureRmVmss cmdlet. This virtual machine object contains the updated state for the VMSS.VirtualMachineScaleSetVirtualMachineScaleSetnoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Update the state of a VMSS to the state of a local VMSS object. PS C:\>Update-AzureRmVmss -ResourceGroupName "Group001" -Name "VMSS001" -VirtualMachineScaleSet "LocalVMSS" +This command updates the state of the VMSS named VMSS001 that belongs to the resource group named Group001 to the state of a local VMSS object named LocalVMSS.Get-AzureRmVmssNew-AzureRmVmssRemove-AzureRmVmssRestart-AzureRmVmssSet-AzureRmVmssStart-AzureRmVmssStop-AzureRmVmssUpdate-AzureRmVMUpdates the state of an Azure virtual machine. UpdateAzureRmVMThe Update-AzureRmVM cmdlet updates the state of an Azure virtual machine to the state of a virtual machine object.Update-AzureRmVMIdSpecifies the Resource ID of the virtual machine.StringTagsSpecifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.HashtableVMSpecifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. PSVirtualMachineConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.Update-AzureRmVMResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringTagsSpecifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.HashtableVMSpecifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. PSVirtualMachineConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.IdSpecifies the Resource ID of the virtual machine.StringStringnoneResourceGroupNameSpecifies the name of the resource group of the virtual machine.StringStringnoneTagsSpecifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.HashtableHashtablenoneVMSpecifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine. PSVirtualMachinePSVirtualMachinenoneConfirmPrompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.SwitchParameterSwitchParameterfalseWhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.SwitchParameterSwitchParameterfalseExample 1: Update a virtual machinePS C:\>Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine +This command updates the virtual machine named VirtualMachine07 in ResourceGroup11. The command updates it by using another virtual machine object, stored in the $VirtualMachine variable. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.Get-AzureRmVMNew-AzureRmVMRemove-AzureRmVMRestart-AzureRmVMStart-AzureRmVMStop-AzureRmVMNew-AzureRmVMConfig +