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 e6b2b1574f74..2414cbd7f060 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 @@ -2916,7 +2916,7 @@ $ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmna ResourceGroupName The resource group name. - + string @@ -2974,7 +2974,7 @@ $ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmna - + @@ -2985,13 +2985,13 @@ $ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmna Microsoft.Azure.Commands.Compute.Extension.DSC.VirtualMachineDscExtensionContext - + - + - + @@ -3002,14 +3002,14 @@ $ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmna - + - + @@ -5951,7 +5951,7 @@ By default the command does no produce any output; use the -Verbose option to di Type - Type of Storage Account. Valid values are + Type of Storage Account. Valid values are • Standard_LRS (Locally-redundant storage) • Standard_ZRS (Zone-redundant storage) • Standard_GRS (Geo-redundant storage) @@ -6017,7 +6017,7 @@ By default the command does no produce any output; use the -Verbose option to di Type - Type of Storage Account. Valid values are + Type of Storage Account. Valid values are • Standard_LRS (Locally-redundant storage) • Standard_ZRS (Zone-redundant storage) • Standard_GRS (Geo-redundant storage) @@ -8180,93 +8180,425 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av +>>>>>>> 648c7babd1ebd26be6b156ee710c27906938c4fe - - Remove-AzureVMDscExtension + Add-AzureVMAdditionalUnattendContent - Removes DSC extension handler from a VM in a resource group + Adds information to the unattended Windows Setup answer file. - Remove - AzureVMDscExtension + Add + AzureVMAdditionalUnattendContent - Removes DSC extension handler from a VM in a resource group + The Add-AzureVMAdditionalUnattendContent 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. - Remove-AzureVMDscExtension - - ResourceGroupName + Add-AzureVMAdditionalUnattendContent + + VM - The name of the resource group + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. - String + PSVirtualMachine - - VMName + + Content - The name of the virtual machine + 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 + + + SettingName + + Specifies the name of the setting to which the content applies. Valid values are: + +-- FirstLogonCommands +-- AutoLogon + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + SettingName + + Specifies the name of the setting to which the content applies. Valid values are: + +-- FirstLogonCommands +-- AutoLogon + + String + + String + + + none + + + VM + + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add content to unattend.xml + + + + + PS C:\>$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> $Credential = Get-Credential +PS C:\> $VirtualMachine = Set-AzureVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName "Contoso26" -Credential $Credential +PS C:\> $AucContent = "<UserAccounts><AdministratorPassword><Value>" + "Password" + "</Value><PlainText>true</PlainText></AdministratorPassword></UserAccounts>"; +PS C:\> $VirtualMachine = Add-AzureVMAdditionalUnattendContent -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-AzureVMOperatingSystem 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-AzureAvailabilitySet + + + + Set-AzureVMOperatingSystem + + + + New-AzureVMConfig + + + + + + + Add-AzureVMDataDisk + + Adds a data disk to a virtual machine. + + + + + Add + AzureVMDataDisk + + + + The Add-AzureVMDataDisk 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-AzureVMDataDisk + + VM + + Specifies the local virtual machine object to which to add a data disk. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine - + Name - Name of the Extension. This is defaulted to 'Microsoft.Powershell.DSC' + 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. 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. + + + ReadOnly + ReadWrite + + + + DiskSizeInGB + + Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. + + Int32] + + + Lun + + Specifies the logical unit number (LUN) for a data disk. + + Int32] + + + CreateOption + + Specifies whether this cmldet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. Valid values are: + +-- Attach +-- Empty +-- FromImage + + + empty + attach + fromImage + + + + SourceImageUri + + Specifies the source URI of the disk that this cmdlet attaches. + + System.String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + - - ResourceGroupName + + Caching - The name of the resource group + 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. - String + String String - + - + none - - VMName + + CreateOption - The name of the virtual machine + Specifies whether this cmldet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. Valid values are: + +-- Attach +-- Empty +-- FromImage - String + System.String - String - + System.String + - + none - + + DiskSizeInGB + + Specifies the size, in gigabytes, of an empty disk to attach to a virtual machine. + + Int32] + + Int32] + + + none + + + Lun + + Specifies the logical unit number (LUN) for a data disk. + + Int32] + + Int32] + + + none + + Name - Name of the Extension. This is defaulted to 'Microsoft.Powershell.DSC' + Specifies the name of the data disk to add. String String - + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + SourceImageUri + + Specifies the source URI of the disk that this cmdlet attaches. + + System.String + + System.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 + + + VM + + Specifies the local virtual machine object to which to add a data disk. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none - - - + + + + + + + @@ -8277,9 +8609,13 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av - - - + + + + + + + @@ -8287,2769 +8623,8757 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av - - - - - - - - + + - -------------------------- Remove an Extension -------------------------- + Example 1: Add data disks to a new virtual machine - PS C:\> + + - PS C:\> Remove-AzureVMDscExtension –ResouceGroupName "RG" -VMName "vm1" -Name "extnname" + PS C:\>$VirtualMachine = New-AzureVMConfig -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-AzureVMDataDisk -VM $VirtualMachine -Name 'DataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $DataDiskVhdUri1 -CreateOption Empty +PS C:\> $VirtualMachine = Add-AzureVMDataDisk -VM $VirtualMachine -Name 'DataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $DataDiskVhdUri2 -CreateOption Empty +PS C:\> $VirtualMachine = Add-AzureVMDataDisk -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 machine + + + + + PS C:\>$VirtualMachine = Get-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Add-AzureVMDataDisk -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-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine + + + + The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureVM 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. + - - - - + + + Remove-AzureVMDataDisk + + + + Get-AzureVM + + + + New-AzureVMConfig + + - - - - Remove-AzureVMNetworkInterface - - Remove the network interface from the VM - - - - - Remove - AzureVMNetworkInterface - - - - Remove the network interface from the VM - - - - Remove-AzureVMNetworkInterface - - VM - - The VM object - - PSVirtualMachine - - - Id - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - The VM object - - PSVirtualMachine - - PSVirtualMachine - - - - - - Id - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Restart-AzureVM - - Restart a VM - - - - - Restart - AzureVM - - - - Restart a VM - - - - Restart-AzureVM - - ResourceGroupName - - Name of Resource Group - - String - - - Name - - Name of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - PS C:\> Restart-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - - - - - - - - - - - - - - - - - - - - - Save-AzureVMImage - - Allows you to capture your VM as a VMImage - - - - - Save - AzureVMImage - - - - Allows you to capture your VM as a VMImage. Required step before this is to sysprep the VM and mark it generalized using the Set-AzureVM -Generalize cmdlet. - The output is a JSON template that can be used to deploy from your captured image. - - - - Save-AzureVMImage - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - DestinationContainerName - - This is the name of the container inside which the vhds constituting the VMImage will reside. If they are spread across multiple storage accounts, one container with this name will be created in each storage account. - - String - - - VHDNamePrefix - - This is the prefix in the name of the blobs that will constitute the storage profile of the VMImage. For e.g. the OSDisk can be named vhdPrefix-osdisk - - String - - - Overwrite - - Indicates if any vhds with same Prefix inside the destination Container are encountered, should they be overwritten or not. - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - DestinationContainerName - - This is the name of the container inside which the vhds constituting the VMImage will reside. If they are spread across multiple storage accounts, one container with this name will be created in each storage account. - - String - - String - - - - - - VHDNamePrefix - - This is the prefix in the name of the blobs that will constitute the storage profile of the VMImage. For e.g. the OSDisk can be named vhdPrefix-osdisk - - String - - String - - - - - - Overwrite - - Indicates if any vhds with same Prefix inside the destination Container are encountered, should they be overwritten or not. - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Save-AzureVMImage -ResourceGroupName "RG1" -VMName "VM1" -DestinationContainerName "VM1" -VHDNamePrefix "VM1" - - Captures the VMImage. The Output property returns a JSON template that can be used to deploy from the captured VMImage. - - - - - - - - - - - - - - - - - - - - Set-AzureStorageAccount - - Update the Storage Account properties - - - - - Set - AzureStorageAccount - - - - This cmdlet allows you to update the Storage Account properties. - - - - Set-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - Type - - Specifies the account type of the storage account. One of four options: - • Standard_LRS (Locally-redundant storage) - • Standard_GRS (Geo-redundant storage) - • Standard_RAGRS (Read access geo-redundant storage) - • Standard_ZRS - - Note that Standard_ZRS accounts cannot be changed to other account types, and other account types cannot be changed to Standard_ZRS. - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - CustomDomainName - - The name of the custom domain. - - String - - - UseSubDomain - - - - Nullable`1[Boolean] - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - Tags - - - - Hashtable[] - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the Storage Account - - String - - String - - - - - - Type - - Specifies the account type of the storage account. One of four options: - • Standard_LRS (Locally-redundant storage) - • Standard_GRS (Geo-redundant storage) - • Standard_RAGRS (Read access geo-redundant storage) - • Standard_ZRS - - Note that Standard_ZRS accounts cannot be changed to other account types, and other account types cannot be changed to Standard_ZRS. - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - CustomDomainName - - The name of the custom domain. - - String - - String - - - - - - UseSubDomain - - - - Nullable`1[Boolean] - - Nullable`1[Boolean] - - - - - - Tags - - - - Hashtable[] - - Hashtable[] - - - - - - UseSubDomainName - - - - nullable`1[boolean] - - nullable`1[boolean] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Set Storage Account type -------------------------- - - PS C:\> - - PS C:\> # Set account type - Set-AzureStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -AccountType "Standard_RAGRS" - - - - - - - - - - - - - - - - -------------------------- Set Custom Domain -------------------------- - - PS C:\> - - PS C:\> #Set custom domain - Set-AzureStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -CustomDomainName "domain name" –UseSubDomain “true” - - - - - - - - - - - - - - - - - - - - - - Set-AzureVM - - This cmdlet is used for marking the VM as generalized - - - - - Set - AzureVM - - - - This cmdlet is used for marking the VM as generalized - - - - Set-AzureVM - - ResourceGroupName - - Resource Group of the VM - - String - - - Name - - Name of the VM - - String - - - Generalized - - Used to mark the VM as Generalized - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Generalized - - Used to mark the VM as Generalized - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Set-AzureVM -ResourceGroupName "RG1" -Name "VM1" -Generalized - - - - - - - - - - - - - - - - - - - - - - Set-AzureVMAccessExtension - - Add VMAccess extension to the VM which allows you to reset the VM username and password - - - - - Set - AzureVMAccessExtension - - - - Add VMAccess extension to the VM which allows you to reset the VM username and password - - - - Set-AzureVMAccessExtension - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension - - String - - - TypeHandlerVersion - - Version of the extension - - String - - - UserName - - New username of the VM - - String - - - Password - - New password of the VM - - String - - - Location - - Location of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the extension - - String - - String - - - - - - TypeHandlerVersion - - Version of the extension - - String - - String - - - - - - UserName - - New username of the VM - - String - - String - - - - - - Password - - New password of the VM - - String - - String - - - - - - Location - - Location of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $extname = 'csetest'; -$extver = '2.0'; -$user2 = "Bar12"; -$password2 = 'FoO@123' + $rgname; - -# Set VMAccess extension -Set-AzureVMAccessExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -TypeHandlerVersion $extver -UserName $user2 -Password $password2; - - - - - - - - - - - - - - - - - - - - - - Set-AzureVMCustomScriptExtension - - Add a custom script extension to the VM which allows you to execute your own scripts on the VM - - - - - Set - AzureVMCustomScriptExtension - - - - Add a custom script extension to the VM which allows you to execute your own scripts on the VM - - - - Set-AzureVMCustomScriptExtension - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension - - String - - - TypeHandlerVersion - - Version of the extension - - String - - - ContainerName - - Azure Storage container name where the script is placed - - String - - - FileName - - Name of the script file - - String[] - - - StorageAccountName - - Azure Storage account name where the script is placed - - String - - - StorageEndpointSuffix - - - - String - - - StorageAccountKey - - Azure storage account key - - String - - - Run - - The command to execute to run your script - - String - - - Argument - - Arguments that need to be passed in to the script - - String - - - Location - - Location of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureVMCustomScriptExtension - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension - - String - - - TypeHandlerVersion - - Version of the extension - - String - - - FileUri - - - - String[] - - - Run - - The command to execute to run your script - - String - - - Argument - - Arguments that need to be passed in to the script - - String - - - Location - - Location of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the extension - - String - - String - - - - - - TypeHandlerVersion - - Version of the extension - - String - - String - - - - - - ContainerName - - Azure Storage container name where the script is placed - - String - - String - - - - - - FileName - - Name of the script file - - String[] - - String[] - - - - - - StorageAccountName - - Azure Storage account name where the script is placed - - String - - String - - - - - - StorageEndpointSuffix - - - - String - - String - - - - - - StorageAccountKey - - Azure storage account key - - String - - String - - - - - - Run - - The command to execute to run your script - - String - - String - - - - - - Argument - - Arguments that need to be passed in to the script - - String - - String - - - - - - Location - - Location of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - FileUri - - - - String[] - - String[] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $extname = 'csetest'; -$extver = '1.1'; -$publisher = 'Microsoft.Compute'; -$exttype = 'CustomScriptExtension'; -$fileToExecute = 'a.exe'; -$containderName = 'script'; - -# Set custom script extension -Set-AzureVMCustomScriptExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -TypeHandlerVersion $extver -StorageAccountName $stoname -StorageAccountKey $stokey -FileName $fileToExecute -ContainerName $containderName; - - - - - - - - - - - - - - - - - - - - - - Set-AzureVMExtension - - Add or Update a VM extension on a VM - - - - - Set - AzureVMExtension - - - - This cmdlet allows you to add an Extensions to a VM or update an existing Extensions properties - - - - Set-AzureVMExtension - - ResourceGroupName - - Name of the Resource Group - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the Extension - - String - - - Publisher - - Name of the extension publisher as provided when the extension was registered. - - String - - - ExtensionType - - - - String - - - TypeHandlerVersion - - The version of the extension to be used on the VM. - - String - - - Settings - - Public configuration for the Extension that do not require encryption. This parameter accepts a Hast Table object. - - Hashtable - - - ProtectedSettings - - Private configuration for the Extension that will be encrypted. This parameter accepts a Hast Table object. - - Hashtable - - - Location - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureVMExtension - - ResourceGroupName - - Name of the Resource Group - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the Extension - - String - - - Publisher - - Name of the extension publisher as provided when the extension was registered. - - String - - - ExtensionType - - - - String - - - TypeHandlerVersion - - The version of the extension to be used on the VM. - - String - - - SettingString - - Public configuration for the Extension that do not require encryption. This parameter accepts string input. - - String - - - ProtectedSettingString - - Private configuration for the Extension that will be encrypted. This parameter accepts string input. - - String - - - Location - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the Extension - - String - - String - - - - - - Publisher - - Name of the extension publisher as provided when the extension was registered. - - String - - String - - - - - - ExtensionType - - - - String - - String - - - - - - TypeHandlerVersion - - The version of the extension to be used on the VM. - - String - - String - - - - - - Settings - - Public configuration for the Extension that do not require encryption. This parameter accepts a Hast Table object. - - Hashtable - - Hashtable - - - - - - ProtectedSettings - - Private configuration for the Extension that will be encrypted. This parameter accepts a Hast Table object. - - Hashtable - - Hashtable - - - - - - Location - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - SettingString - - Public configuration for the Extension that do not require encryption. This parameter accepts string input. - - String - - String - - - - - - ProtectedSettingString - - Private configuration for the Extension that will be encrypted. This parameter accepts string input. - - String - - String - - - - - - Type - - Type of Extension - - string - - string - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Set Extension by Hash Table input -------------------------- - - PS C:\> - - PS C:\> $rgname = "RG1" - $loc = "West US" - $vmname = "myVM" + +<<<<<<< HEAD + + Add-AzureVMNetworkInterface + + Adds a network interface to a virtual machine. + + + + + Add + AzureVMNetworkInterface + + + + The Add-AzureVMNetworkInterface 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-AzureVMNetworkInterface + + VM + + Specifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + + Id + + Specifies the ID of a network interface to add to a virtual machine. To obtain a network interface, use the Get-AzureNetworkInterface cmdlet. + + String + + + Primary + + Indicates that this cmdlet adds the network interface as the primary interface. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Id + + Specifies the ID of a network interface to add to a virtual machine. To obtain a network interface, use the Get-AzureNetworkInterface cmdlet. + + String + + String + + + none + + + Primary + + Indicates that this cmdlet adds the network interface as the primary interface. + + SwitchParameter + + SwitchParameter + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + VM + + Specifies a local virtual machine object to which to add a network interface. To create a virtual machine, use the New-AzureVMConfig cmdlet. To obtain an existing virtual machine, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add a network interface to a new virtual machine + + + + + PS C:\>$VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" +PS C:\> Add-AzureVMNetworkInterface -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 machine + + + + + PS C:\>$VirtualMachine = Get-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Add-AzureVMNetworkInterface -VM $VirtualMachine -Id "/subscriptions/46fc8ea4-2de6-4179-8ab1-365da4121af4/resourceGroups/contoso/providers/Microsoft.Network/networkInterfaces/sshNIC" +PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name " VirtualMachine07" -VM $VirtualMachine + + + The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureVM cmldet. 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-AzureVMConfig + + + + Get-AzureVM + + + + Get-AzureAvailabilitySet + + + + + + + Add-AzureVMSecret + + Adds a secret to a virtual machine. + + + + + Add + AzureVMSecret + + + + The Add-AzureVMSecret cmdlet adds a secret to a virtual machine. This value lets you add a certificate to the virtual machine. The secret needs to 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/) in the Azure library. 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 type Get-Help Set-AzureKeyVaultSecret. + + + + Add-AzureVMSecret + + VM + + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + 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 + + + VM + + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add a secret to a virtual machine + + + + + PS C:\>$VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> $Credential = Get-Credential +PS C:\> $VirtualMachine = Set-AzureVMOperatingSystem -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-AzureVMSecret -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 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-AzureVMOperatingSystem cmdlet to configure the virtual machine stored in $VirtualMachine. + The fifth 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 sixth command assigns a value to the $CertificateStore01 variable for later use. + The seventh command assigns a URL for a certificate store. + The eighth 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-AzureVMSecret repeatedly to add secrets for other certificates. + + + + + + + + + + + + + + + + Add-AzureVMSshPublicKey + + Adds the public keys for SSH for a virtual machine. + + + + + Add + AzureVMSshPublicKey + + + + The Add-AzureVMSshPublicKey cmdlet adds the public keys that you can use to connect to a virtual machine over Secure Shell (SSH). + + + + Add-AzureVMSshPublicKey + + VM + + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + + KeyData + + Specifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + KeyData + + Specifies a base 64 encoding of a public key. You can connect to a virtual machine by using SSH 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + VM + + Specifies the virtual machine object that this cmdlet modifies. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add a public key to a virtual machine + + + + + PS C:\>$VirtualMachine = Get-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> $VirtualMachine = Add-AzureVMSshPublicKey -VM $VirtualMachine -KeyData "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV" -Path "/home/admin/.ssh/authorized_keys" + + + The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureVM 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-AzureVM + + + + + + + Get-AzureAvailabilitySet + + Gets Azure availability sets in a resource group. + + + + + Get + AzureAvailabilitySet + + + + The Get-AzureAvailabilitySet cmdlet gets Azure availability sets in a resource group. Specify the name of a specific availability set to get. + + + + Get-AzureAvailabilitySet + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + Name + + Specifies the name of an availability set to get. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of an availability set to get. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get a specific availability set + + + + + PS C:\>Get-AzureAvailabilitySet -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:\>Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" + + + This command gets all the availability sets in the resource group named ResourceGroup11. + + + + + + + + + + + + + New-AzureAvailabilitySet + + + + Remove-AzureAvailabilitySet + + + + + + + Get-AzureRemoteDesktopFile + + Gets an .rdp file. + + + + + Get + AzureRemoteDesktopFile + + + + The Get-AzureRemoteDesktopFile cmdlet gets a Remote Desktop Protocol (.rdp) file. + + + + Get-AzureRemoteDesktopFile + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + LocalPath + + Specifies the local full path where this cmdlet stores the .rdp file. + + String + + String + + + none + + + Name + + Specifies the name of the availability set that this cmdlet gets. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get a Remote Desktop file + + + + + PS C:\>Get-AzureRemoteDesktopFile -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-AzureVMAccessExtension + + Gets information about the VMAccess extension. + + + + + Get + AzureVMAccessExtension + + + + The Get-AzureVMAccessExtension cmdlet gets information about the Virtual Machine Access (VMAccess) Virtual Machine Extension. + + + + Get-AzureVMAccessExtension + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of the extension that this cmdlet gets. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + String + + + none + + + Status + + Indicates that this cmdlet gets only the instance view of the extension. + + SwitchParameter + + SwitchParameter + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get the VMAccess extension + + + + + PS C:\>$VMAccessExtension = Get-AzureVMAccessExtension -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-AzureVMAccessExtension -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine0" -Name "ContosoTest" -Status + + + This command gets the instance view of the VMAccess extension named ContosoTest for the virtual machine named VirtualMachine07. + + + + + + + + + + + + + Remove-AzureVMAccessExtension + + + + Set-AzureVMAccessExtension + + + + Get-AzureVMExtension + + + + + + + Get-AzureVMCustomScriptExtension + + Gets information about a custom script extension. + + + + + Get + AzureVMCustomScriptExtension + + + + The Get-AzureVMCustomScriptExtension cmdlet gets information about a custom script Virtual Machine Extension on a virtual machine. + + + + Get-AzureVMCustomScriptExtension + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of the custom script extension about which this cmdlet gets information. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + String + + + none + + + Status + + Indicates that this cmdlet gets the instance view of the custom script extension. + + SwitchParameter + + SwitchParameter + + + none + + + VMName + + Specifies the name of a virtual machine for which this cmdlet gets the custom script extension. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get a custom script extension + + + + + PS C:\>$VMCustomScriptExtension = Get-AzureVMCustomScriptExtension -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:\>$VMCustomScriptExtension = Get-AzureVMCustomScriptExtension -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-AzureVMExtension + + + + Get-AzureVMExtensionImage + + + + Get-AzureVMAccessExtension + + + + + + + Get-AzureVMExtensionImageDetail + + This cmdlet has been deprecated. + + + + + Get + AzureVMExtensionImageDetail + + + + This Get-AzureVMExtensionImageDetail cmdlet has been deprecated. + + + + Get-AzureVMExtensionImageDetail + + FilterExpression + + + String + + + Profile + + + AzureProfile + + + Version + + + String + + + Location + + + String + + + PublisherName + + + String + + + Type + + + String + + + + + + FilterExpression + + + String + + String + + + none + + + Location + + + String + + String + + + none + + + Profile + + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + + String + + String + + + none + + + Type + + + String + + String + + + none + + + Version + + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1: + + + + + PS C:\> + + + + + + + + + + + + + + + + + + + + Get-AzureVMExtensionImageType + + Gets the type of an Azure extension. + + + + + Get + AzureVMExtensionImageType + + + + The Get-AzureVMExtensionImageType cmdlet gets the type of an Azure extension. + + + + Get-AzureVMExtensionImageType + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + 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-AzureVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies. + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + Specifies the name of a publisher of an extension. To obtain an extension publisher, use the Get-AzureVMImagePublisher cmdlet. This cmdlet gets the type for an extension from the publisher that this parameter specifies. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get an extension image type + + + + + PS C:\>Get-AzureVMExtensionImageType -Location "Central US" -PublisherName "Fabrikam" + + + This command gets the extension image type for the specified publisher and location. + + + + + + + + + + + + + Get-AzureVMExtensionImage + + + + + + + Get-AzureVMExtensionImage + + Gets all versions for an Azure extension. + + + + + Get + AzureVMExtensionImage + + + + The Get-AzureVMExtensionImage cmdlet gets all versions for an Azure extension. + + + + Get-AzureVMExtensionImage + + FilterExpression + + Specifies a filter expression. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + Version + + + + + System.String + + + Location + + Specifies the location of an extension. + + String + + + PublisherName + + Specifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureVMImagePublisher cmdlet. + + String + + + Type + + Specifies the type of the extension. To obtain an extension type, use the Get-AzureVMExtensionImageType cmdlet. + + String + + + + + + FilterExpression + + Specifies a filter expression. + + String + + String + + + none + + + Location + + Specifies the location of an extension. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + Specifies the name of an extension publisher. To obtain an extension publisher, use the Get-AzureVMImagePublisher cmdlet. + + String + + String + + + none + + + Type + + Specifies the type of the extension. To obtain an extension type, use the Get-AzureVMExtensionImageType cmdlet. + + String + + String + + + none + + + Version + + + + + System.String + + System.String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get the versions of an extension image + + + + + PS C:\>Get-AzureVMExtensionImage -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-AzureVMExtensionImageType + + + + Get-AzureVMImage + + + + Get-AzureVMImagePublisher + + + + Get-AzureVMExtensionImageType + + + + + + + Get-AzureVMExtension + + Gets properties of Virtual Machine Extensions installed on a virtual machine. + + + + + Get + AzureVMExtension + + + + The Get-AzureVMExtension 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-AzureVMExtension + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of an extension. This cmdlet gets properties for the extension that this parameter specifies. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + Status + + Indicates that this cmdlet gets only the instance view of an extension. + + SwitchParameter + + SwitchParameter + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get properties of an extension + + + + + PS C:\>Get-AzureVMExtension -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:\>Get-AzureVMExtension -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-AzureVMExtension + + + + Set-AzureVMExtension + + + + + + + Get-AzureVMImageDetail + + This cmdlet has been deprecated. + + + + + Get + AzureVMImageDetail + + + + The Get-AzureVMImageDetail cmdlet has been deprecated. + + + + Get-AzureVMImageDetail + + Profile + + + AzureProfile + + + Location + + + String + + + Offer + + + String + + + PublisherName + + + String + + + Skus + + + String + + + Version + + + String + + + + + + Location + + + String + + String + + + none + + + Offer + + + String + + String + + + none + + + Profile + + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + + String + + String + + + none + + + Skus + + + String + + String + + + none + + + Version + + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1: + + + + + PS C:\> + + + + + + + + + + + + + + + + + + + + Get-AzureVMImageOffer + + Gets VMImage offer types. + + + + + Get + AzureVMImageOffer + + + + The Get-AzureVMImageOffer cmdlet gets the VMImage offer types. + + + + Get-AzureVMImageOffer + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + 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-AzureVMImagePublisher cmdlet. + + String + + + + + + Location + + Specifies the location of the VMImage. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureVMImagePublisher cmdlet. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get offer types for a publisher + + + + + PS C:\>Get-AzureVMImageOffer -Location "Central US" -PublisherName "Fabrikam" + + + This command gets the offer types for the specified publisher in the Central US region. + + + + + + + + + + + + + Get-AzureVMImage + + + + Get-AzureVMImagePublisher + + + + Get-AzureVMImageSku + + + + Save-AzureVMImage + + + + + + + Get-AzureVMImagePublisher + + Gets the VMImage publishers. + + + + + Get + AzureVMImagePublisher + + + + The Get-AzureVMImagePublisher cmdlet gets the VMImage publishers. + + + + Get-AzureVMImagePublisher + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + Location + + Specifies the location of the VMImage. + + String + + + + + + Location + + Specifies the location of the VMImage. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get VMImage publishers for a region + + + + + PS C:\>Get-AzureVMImagePublisher -Location "Central US" + + + This command gets the publishers of VMImage instances for the Central US region within your profile. + + + + + + + + + + + + + Get-AzureVMImage + + + + Get-AzureVMImageOffer + + + + Get-AzureVMImageSku + + + + Save-AzureVMImage + + + + + + + Get-AzureVMImageSku + + Gets VMImage SKUs. + + + + + Get + AzureVMImageSku + + + + The Get-AzureVMImageSku cmdlet gets VMImage SKUs. + + + + Get-AzureVMImageSku + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + Location + + Specifies the location of the VMImage. + + String + + + Offer + + Specifies the type of VMImage offer. + + String + + + PublisherName + + Specifies the publisher of a VMImage. + + String + + + + + + Location + + Specifies the location of the VMImage. + + String + + String + + + none + + + Offer + + Specifies the type of VMImage offer. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + PublisherName + + Specifies the publisher of a VMImage. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get SKUs + + + + + PS C:\>Get-AzureVMImageSku -Location "Central US" -PublisherName "Fabrikam" -Offer "LinuxServer" + + + This command gets the SKUs for the specified publisher and offer. + + + + + + + + + + + + + Get-AzureVMImage + + + + Get-AzureVMImageOffer + + + + Get-AzureVMImagePublisher + + + + Save-AzureVMImage + + + + + + + Get-AzureVMImage + + Gets all the versions of a VMImage. + + + + + Get + AzureVMImage + + + + The Get-AzureVMImage cmdlet gets all the versions of a VMImage. + + + + Get-AzureVMImage + + FilterExpression + + Specifies a filter expression. + + System.String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + Location + + Specifies the location of a VMImage. + + System.String + + + Offer + + Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureVMImageOffer cmdlet. + + System.String + + + PublisherName + + Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureVMImagePublisher cmdlet. + + System.String + + + Skus + + Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureVMImageSku cmdlet. + + System.String + + + + Get-AzureVMImage + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + Location + + Specifies the location of a VMImage. + + System.String + + + Offer + + Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureVMImageOffer cmdlet. + + System.String + + + PublisherName + + Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureVMImagePublisher cmdlet. + + System.String + + + Skus + + Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureVMImageSku cmdlet. + + System.String + + + Version + + + + + System.String + + + + + + FilterExpression + + Specifies a filter expression. + + System.String + + System.String + + + none + + + Location + + Specifies the location of a VMImage. + + System.String + + System.String + + + none + + + Offer + + Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureVMImageOffer cmdlet. + + System.String + + System.String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + none + + + PublisherName + + Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureVMImagePublisher cmdlet. + + System.String + + System.String + + + none + + + Skus + + Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureVMImageSku cmdlet. + + System.String + + System.String + + + none + + + Version + + + + + System.String + + System.String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get VMImage objects + + + + + PS C:\>Get-AzureVMImage -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-AzureVMImageOffer + + + + Get-AzureVMImagePublisher + + + + Get-AzureVMImageSku + + + + Save-AzureVMImage + + + + + + + Get-AzureVMSize + + Gets available virtual machine sizes. + + + + + Get + AzureVMSize + + + + The Get-AzureVMSize cmdlet gets available virtual machine sizes. + + + + Get-AzureVMSize + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Get-AzureVMSize + + Location + + Specifies the location for which this cmdlet gets the available virtual machine sizes. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Get-AzureVMSize + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + AvailabilitySetName + + Specifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes. + + String + + String + + + none + + + Location + + Specifies the location for which this cmdlet gets the available virtual machine sizes. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + 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 sizes for a location + + + + + PS C:\>Get-AzureVMSize -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:\>Get-AzureVMSize -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:\>Get-AzureVMSize -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-AzureVM + + + + + + + Get-AzureVMUsage + + Gets the virtual machine core count usage for a location. + + + + + Get + AzureVMUsage + + + + The Get-AzureVMUsage cmdlet gets the virtual machine core count usage for a location. + + + + Get-AzureVMUsage + + Location + + Specifies the location for which this cmdlet gets virtual machine core count usage. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Location + + Specifies the location for which this cmdlet gets virtual machine core count usage. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get core count usage for a location + + + + + PS C:\>Get-AzureVMUsage -Location "Central US" + + + This command gets the virtual machine core count usage for the location Central US. + + + + + + + + + + + + + + + + Get-AzureVM + + Gets the properties of a virtual machine. + + + + + Get + AzureVM + + + + The Get-AzureVM 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. To get only the instance view of a virtual machine, specify the Status parameter. + + + + Get-AzureVM + + ResourceGroupName + + Specifies the name of a resource group. + + System.String + + + Name + + Specifies the name of the virtual machine to get. + + System.String + + + Status + + Indicates that this cmdlet gets only the instance view of the virtual machine. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + Get-AzureVM + + NextLink + + Specifies the next link. + + System.Uri + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + Get-AzureVM + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + Get-AzureVM + + ResourceGroupName + + Specifies the name of a resource group. + + System.String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + + + Name + + Specifies the name of the virtual machine to get. + + System.String + + System.String + + + none + + + NextLink + + Specifies the next link. + + System.Uri + + System.Uri + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + System.String + + System.String + + + none + + + Status + + Indicates that this cmdlet gets only the instance view of the virtual machine. + + SwitchParameter + + SwitchParameter + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Get model and instance view properties + + + + + PS C:\>Get-AzureVM -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:\>Get-AzureVM -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:\> Get-AzureVM -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-AzureVM + + + + This command gets all the virtual machines in your subscription. + + + + + + + + + + + + + New-AzureVM + + + + Remove-AzureVM + + + + Restart-AzureVM + + + + Start-AzureVM + + + + Stop-AzureVM + + + + Update-AzureVM + + + + + + + New-AzureAvailabilitySet + + Creates an Azure availability set. + + + + + New + AzureAvailabilitySet + + + + The New-AzureAvailabilitySet cmdlet creates an Azure availability set. + + + + New-AzureAvailabilitySet + + 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 [System.Int32] + + + PlatformFaultDomainCount + + Specifies the platform fault domain count. + + Nullable [System.Int32] + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Location + + Specifies the location for the availability set. + + String + + String + + + none + + + Name + + Specifies a name for the availability set. + + String + + String + + + none + + + PlatformFaultDomainCount + + Specifies the platform fault domain count. + + Nullable [System.Int32] + + Nullable [System.Int32] + + + none + + + PlatformUpdateDomainCount + + Specifies the platform update domain count. + + Nullable [System.Int32] + + Nullable [System.Int32] + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Create an availability set + + + + + PS C:\>New-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -Location "West US" + + + This command creates an availability set named AvailablitySet03 in the resource group named ResourceGroup11. + + + + + + + + + + + + + Get-AzureAvailabilitySet + + + + Remove-AzureAvailabilitySet + + + + + + + New-AzureVMConfig + + Creates a configurable virtual machine object. + + + + + New + AzureVMConfig + + + + The New-AzureVMConfig cmdlet creates a configurable local virtual machine object for Azure. Configure a virtual machine object by using other cmdlets, such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Add-AzureVMNetworkInterface, and Set-AzureVMOSDisk. + + + + New-AzureVMConfig + + 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-AzureAvailabilitySet cmdlet. The availability set object contains an ID property. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + AvailabilitySetId + + Specifies the ID of an availability set. To obtain an availability set object, use the Get-AzureAvailabilitySet cmdlet. The availability set object contains an ID property. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + VMName + + Specifies a name for the virtual machine. + + String + + String + + + none + + + VMSize + + Specifies the size for the virtual machine. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Create a virtual machine object + + + + + PS C:\>$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureVMConfig -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-AzureVM + + + + Set-AzureVMOperatingSystem + + + + Set-AzureVMSourceImage + + + + Get-AzureAvailabilitySet + + + + + + + New-AzureVM + + Creates a virtual machine. + + + + + New + AzureVM + + + + The New-AzureVM cmdlet creates a virtual machine in Azure. This cmdlet takes a virtual machine object as input. Use the New-AzureVMConfig cmdlet to create a virtual machine object. Configure the virtual machine object by using other cmdlets, such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Add-AzureVMNetworkInterface, and Set-AzureVMOSDisk. + + + + New-AzureVM + + Name + + Specifies a name for the virtual machine. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + Tags + + + + + System.Collections.Hashtable[] + + + Location + + Specifies a location for the virtual machine. + + String + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + VM + + Specifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureVMConfig cmdlet. Configure the virtual machine by using other cmdlets, such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, and Add-AzureVMNetworkInterface. + + PSVirtualMachine + + + + + + Location + + Specifies a location for the virtual machine. + + String + + String + + + none + + + Name + + Specifies a name for the virtual machine. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + Tags + + + + + System.Collections.Hashtable[] + + System.Collections.Hashtable[] + + + none + + + VM + + Specifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzureVMConfig cmdlet. Configure the virtual machine by using other cmdlets, such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, and Add-AzureVMNetworkInterface. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Create a virtual machine + + + + + PS C:\># Variables +## Global +$ResourceGroupName = "ResourceGroup11" +$Location = "westeurope" + +## Storage +$StorageName = "GeneralStorage6cc" +$StorageType = "Standard_GRS" + +## Network +$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" + +# Resource Group +New-AzureResourceGroup -Name $ResourceGroupName -Location $Location + +# Storage +$StorageAccount = New-AzureStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName -Type $StorageType -Location $Location + +# Network +$PIp = New-AzurePublicIpAddress -Name $InterfaceName -ResourceGroupName $ResourceGroupName -Location $Location -AllocationMethod Dynamic +$SubnetConfig = New-AzureVirtualNetworkSubnetConfig -Name $Subnet1Name -AddressPrefix $VNetSubnetAddressPrefix +$VNet = New-AzureVirtualNetwork -Name $VNetName -ResourceGroupName $ResourceGroupName -Location $Location -AddressPrefix $VNetAddressPrefix -Subnet $SubnetConfig +$Interface = New-AzureNetworkInterface -Name $InterfaceName -ResourceGroupName $ResourceGroupName -Location $Location -SubnetId $VNet.Subnets[0].Id -PublicIpAddressId $PIp.Id + +# Compute + +## Setup local VM object +$Credential = Get-Credential +$VirtualMachine = New-AzureVMConfig -VMName $VMName -VMSize $VMSize +$VirtualMachine = Set-AzureVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate +$VirtualMachine = Set-AzureVMSourceImage -VM $VirtualMachine -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest" +$VirtualMachine = Add-AzureVMNetworkInterface -VM $VirtualMachine -Id $Interface.Id +$OSDiskUri = $StorageAccount.PrimaryEndpoints.Blob.ToString() + "vhds/" + $OSDiskName + ".vhd" +$VirtualMachine = Set-AzureVMOSDisk -VM $VirtualMachine -Name $OSDiskName -VhdUri $OSDiskUri -CreateOption FromImage + +## Create the VM in Azure +New-AzureVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $VirtualMachine + + + + + This example script shows how to create a virtual machine. This script uses several other cmdlets. + + + + + + + + + + + + + Get-AzureVM + + + + Remove-AzureVM + + + + Restart-AzureVM + + + + Start-AzureVM + + + + Stop-AzureVM + + + + Update-AzureVM + + + + Add-AzureVMDataDisk + + + + Add-AzureVMNetworkInterface + + + + New-AzureVMConfig + + + + Set-AzureVMOperatingSystem + + + + Set-AzureVMSourceImage + + + + Set-AzureVMOSDisk + + + + + + + Remove-AzureAvailabilitySet + + Removes an availability set from Azure. + + + + + Remove + AzureAvailabilitySet + + + + The Remove-AzureAvailabilitySet cmdlet removes an availability set from Azure. + + + + Remove-AzureAvailabilitySet + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Force + + Forces the command to run without asking for user confirmation. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the availability set to remove. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Remove an availability set + + + + + PS C:\>Remove-AzureAvailabilitySet -Name "AvailabilitySet03" -ResourceGroupName "ResourceGroup11" + + + This command removes an availability set named AvailablitySet03 in the resource group named ResourceGroup11. + + + + + + + + + + + + + Get-AzureAvailabilitySet + + + + New-AzureAvailabilitySet + + + + + + + Remove-AzureVMAccessExtension + + Removes the VMAccess extension from a virtual machine. + + + + + Remove + AzureVMAccessExtension + + + + The Remove-AzureVMAccessExtension cmdlet removes the Virtual Machine Access (VMAccess) Virtual Machine Extension from a virtual machine. + + + + Remove-AzureVMAccessExtension + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Force + + Forces the command to run without asking for user confirmation. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the extension that this cmdlet removes. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + 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 removes VMAccess for the virtual machine that this parameter specifies. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1: + + + + + + + + + + + + + + + + + + Get-AzureVMAccessExtension + + + + Set-AzureVMAccessExtension + + + + Remove-AzureVMExtension + + + + + + + Remove-AzureVMCustomScriptExtension + + Removes a custom script extension from a virtual machine. + + + + + Remove + AzureVMCustomScriptExtension + + + + The Remove-AzureVMCustomScriptExtension cmdlet removes a custom script Virtual Machine Extension from a virtual machine. + + + + Remove-AzureVMCustomScriptExtension + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Force + + Forces the command to run without asking for user confirmation. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the custom script extension that this cmdlet removes. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1: + + + + + + + + + + + + + + + + + + Get-AzureVMCustomScriptExtension + + + + Set-AzureVMCustomScriptExtension + + + + + + + Remove-AzureVMDataDisk + + Removes a data disk from a virtual machine. + + + + + Remove + AzureVMDataDisk + + + + The Remove-AzureVMDataDisk cmdlet removes a data disk from a virtual machine. + + + + Remove-AzureVMDataDisk + + VM + + Specifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + + Name + + Specifies the name of the data disk to add. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of the data disk to add. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + VM + + Specifies the local virtual machine object from which to remove a data disk. To obtain a virtual machine object, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Remove a data disk from a virtual machine + + + + + PS C:\>$VirtualMachine = Get-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" +PS C:\> Remove-AzureVMDataDisk -VM $VirtualMachine -Name "disk3" +PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine + + + The first command gets the virtual machine named VirtualMachine07 by using the Get-AzureVM 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-AzureVMDataDisk + + + + Get-AzureVM + + + + + + + Remove-AzureVMExtension + + Removes an extension from a virtual machine. + + + + + Remove + AzureVMExtension + + + + The Remove-AzureVMExtension cmdlet removes an extension from the Virtual Machine Extensions of a virtual machine. + + + + Remove-AzureVMExtension + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + VMName + + Specifies the name of a virtual machine. This cmdlet removes extensions from the virtual machine that this parameter specifies. + + String + + + Name + + Specifies the name of the extension to remove. + + String + + + Force + + Forces the command to run without asking for user confirmation. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Force + + Forces the command to run without asking for user confirmation. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the extension to remove. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + VMName + + Specifies the name of a virtual machine. This cmdlet removes extensions from the virtual machine that this parameter specifies. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Remove an extension from a virtual machine + + + + + PS C:\>Remove-AzureVMExtension -ResourceGroupName "ResourceGroup11" -Name "ContosoTest" -VMName "VirtualMachine22" + + + This command removes the extension named ContosoTest from the virtual machine named VirtualMachine22 in ResourceGroup11. + + + + + + + + + + + + + Get-AzureVMExtension + + + + Set-AzureVMExtension + + + + + + + Remove-AzureVMNetworkInterface + + Removes a network interface from a virtual machine. + + + + + Remove + AzureVMNetworkInterface + + + + The Remove-AzureVMNetworkInterface cmdlet removes a network interface from a virtual machine. + + + + Remove-AzureVMNetworkInterface + + VM + + Specifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + + Id + + Specifies the ID of the network interface that this cmdlet removes from the virtual machine. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Id + + Specifies the ID of the network interface that this cmdlet removes from the virtual machine. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + VM + + Specifies the virtual machine from which this cmdlet removes a network interface. To obtain a virtual machine object, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1: + + + + + + + + + + + + + + + + + + Get-AzureVM + + + + + + + Remove-AzureVM + + Removes a virtual machine from Azure. + + + + + Remove + AzureVM + + + + The Remove-AzureVM cmdlet removes a virtual machine from Azure. + + + + Remove-AzureVM + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + Name + + Specifies the name of the virtual machine to remove. + + String + + + Force + + Forces the command to run without asking for user confirmation. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Force + + Forces the command to run without asking for user confirmation. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the virtual machine to remove. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Remove a virtual machine + + + + + PS C:\>Remove-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" + + + This command removes the virtual machine named VirtualMachine07 in the resource group ResourceGroup11. + + + + + + + + + + + + + Get-AzureVM + + + + New-AzureVM + + + + Restart-AzureVM + + + + Start-AzureVM + + + + Stop-AzureVM + + + + Update-AzureVM + + + + + + + Restart-AzureVM + + Restarts an Azure virtual machine. + + + + + Restart + AzureVM + + + + The Restart-AzureVM cmdlet restarts an Azure virtual machine. + + + + Restart-AzureVM + + ResourceGroupName + + Specifies the name of the resource group. + + String + + + Name + + Specifies the name of the virtual machine to restart. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of the virtual machine to restart. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Restart a virtual machine + + + + + PS C:\>Restart-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" + + + This command restarts the virtual machine named VirtualMachine07 in ResourceGroup11. + + + + + + + + + + + + + Get-AzureVM + + + + New-AzureVM + + + + Remove-AzureVM + + + + Start-AzureVM + + + + Stop-AzureVM + + + + Update-AzureVM + + + + + + + Save-AzureVMImage + + Captures a virtual machine as a VMImage. + + + + + Save + AzureVMImage + + + + The Save-AzureVMImage cmdlet captures 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-AzureVM cmdlet. + The output of this cmdlet is a JavaScript Object Notation (JSON) template. You can deploy virtual machines from your captured image. + + + + Save-AzureVMImage + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + + VMName + + Specifies the name of the virtual machine that this cmdlet saves. + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + 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 + + + Overwrite + + Indicates that this cmdlet overwrites any VHDs that have the same prefix in the destination container. + + SwitchParameter + + SwitchParameter + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + 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 + + + VMName + + Specifies the name of the virtual machine that this cmdlet saves. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Capture a virtual machine + + + + + PS C:\>Set-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized +PS C:\> Save-AzureVMImage -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -DestinationContainerName "VMContainer01" -VHDNamePrefix "VM07" + + + The first 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-AzureVMImage + + + + Get-AzureVMImageOffer + + + + Get-AzureVMImagePublisher + + + + Get-AzureVMImageSku + + + + Set-AzureVM + + + + + + + Set-AzureVMAccessExtension + + Adds the VMAccess extension to a virtual machine. + + + + + Set + AzureVMAccessExtension + + + + The Set-AzureVMAccessExtension 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-AzureVMAccessExtension + + 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-AzureVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. + + String + + + UserName + + Specifies the new user name for the virtual machine. + + String + + + Password + + Specifies the new password of the virtual machine. + + String + + + Location + + Specifies the location of the virtual machine. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Location + + Specifies the location of the virtual machine. + + String + + String + + + none + + + Name + + Specifies the name of the extension that this cmdlet adds. + + String + + String + + + none + + + Password + + Specifies the new password of the virtual machine. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + String + + + none + + + TypeHandlerVersion + + Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. + + String + + String + + + none + + + UserName + + Specifies the new user name for 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add a VMAccess extension + + + + + PS C:\> Set-AzureVMAccessExtension -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-AzureVMAccessExtension + + + + Remove-AzureVMAccessExtension + + + + Set-AzureVMExtension + + + + Get-AzureVMExtensionImage + + + + + + + Set-AzureVMCustomScriptExtension + + Adds a custom script extension to a virtual machine. + + + + + Set + AzureVMCustomScriptExtension + + + + The Set-AzureVMCustomScriptExtension cmdlet adds a custom script Virtual Machine Extension to a virtual machine. This extension allows you to run your own scripts on the virtual machine. + + + + Set-AzureVMCustomScriptExtension + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + + Run + + Specifies the command to use that runs your script. + + String + + + Argument + + Specifies arguments that the script extension passes to the script. + + String + + + Location + + Specifies the location 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-AzureVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. + + String + + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Set-AzureVMCustomScriptExtension + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + + Location + + Specifies the location 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-AzureVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. + + String + + + 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 + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Argument + + Specifies arguments that the script extension passes to the script. + + String + + String + + + none + + + 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 + + + FileUri + + Specifies the URI of the script file. + + String[] + + String[] + + + none + + + Location + + Specifies the location of the virtual machine. + + String + + String + + + none + + + Name + + Specifies the name of the custom script extension. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + String + + + none + + + Run + + Specifies the command to use that runs your script. + + String + + String + + + none + + + StorageAccountKey + + Specifies the key for the Azure Storage container. + + 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 + + + TypeHandlerVersion + + Specifies the version of the extension to use for this virtual machine. To obtain the version, run the Get-AzureVMExtensionImage cmdlet with a value of Microsoft.Compute for the PublisherName parameter and VMAccessAgent for the Type parameter. + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Add a custom script + + + + + PS C:\>Set-AzureVMCustomScriptExtension -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-AzureVMCustomScriptExtension + + + + Remove-AzureVMCustomScriptExtension + + + + + + + Set-AzureVMExtension + + Updates extension properties or adds an extension to a virtual machine. + + + + + Set + AzureVMExtension + + + + The Set-AzureVMExtension cmdlet updates properties for existing Virtual Machine Extensions or adds an extension to a virtual machine. + + + + Set-AzureVMExtension + + ResourceGroupName + + Specifies the name of a resource group. + + 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 + + + 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. + + System.String + + + TypeHandlerVersion + + Specifies the version of the extension to use for this virtual machine. + + 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 + + + Location + + Specifies the location of the virtual machine. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Set-AzureVMExtension + + ResourceGroupName + + Specifies the name of a resource group. + + 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 + + + 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. + + System.String + + + TypeHandlerVersion + + Specifies the version of the extension to use for this virtual machine. + + 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 + + + Location + + Specifies the location of the virtual machine. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + ExtensionType + + Specifies the extension type. + + System.String + + System.String + + + none + + + Location + + Specifies the location of the virtual machine. + + String + + String + + + none + + + Name + + Specifies the name of an extension. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ProtectedSettings + + Specifies private configuration for the extension, as a hash table. This cmdlet encrypts the private configuration. + + Hashtable + + Hashtable + + + none + + + ProtectedSettingString + + Specifies private configuration for the extension, as a string. This cmdlet encrypts the private configuration. + + String + + String + + + none + + + Publisher + + Specifies the name of the extension publisher. The publisher provides a name when the publisher registers an extension. + + String + + String + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + Settings + + Specifies public configuration for the extension, as a hash table. This cmdlet does not encrypt public configuration. + + Hashtable + + Hashtable + + + none + + + SettingString + + Specifies public configuration for the extension, as a string. This cmdlet does not encrypt public configuration. + + String + + String + + + none + + + TypeHandlerVersion + + Specifies the version of the extension to use for this 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Modify settings by using hash tables + + + + + PS C:\>$Settings = @{"fileUris" = "[]"; "commandToExecute" = ""}; +PS C:\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey}; +PS C:\> Set-AzureVMExtension -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 strings + + + + + PS C:\>$SettingsString = '{"fileUris":[],"commandToExecute":""}'; +PS C:\> $ProtectedSettingsString = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}'; +PS C:\> Set-AzureVMExtension -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-AzureVMExtension + + + + Remove-AzureVMExtension + + + + + + + Set-AzureVMOperatingSystem + + Sets operating system properties for a virtual machine. + + + + + Set + AzureVMOperatingSystem + + + + The Set-AzureVMOperatingSystem cmdlet sets operating system properties for a virtual machine. You can specify logon credentials computer name, and operating system type. + + + + Set-AzureVMOperatingSystem + + VM + + Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + + WinRMHttps + + Indicates that this operating system uses HTTPS WinRM. + + + + WinRMCertificateUrl + + Specifies the URI of a WinRM certificate. This needs to be stored in a Key Vault. + + System.Uri + + + Windows + + Indicates that the type of operating system is Windows. + + + + 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. + + System.String + + + ProvisionVMAgent + + Indicates that the settings require that the virtual machine agent be installed on the virtual machine. + + + + EnableAutoUpdate + + Indicates that this cmdlet enables auto update. + + + + TimeZone + + Specifies the time zone for the virtual machine. + + System.String + + + WinRMHttp + + Indicates that this operating system uses HTTP WinRM. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Set-AzureVMOperatingSystem + + VM + + Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + + Linux + + Indicates that the type of operating system is Linux. + + + + 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. + + System.String + + + DisablePasswordAuthentication + + Indicates that this cmdlet disables password authentication. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + 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. + + System.String + + System.String + + + none + + + DisablePasswordAuthentication + + Indicates that this cmdlet disables password authentication. + + SwitchParameter + + SwitchParameter + + + none + + + EnableAutoUpdate + + Indicates that this cmdlet enables auto update. + + SwitchParameter + + SwitchParameter + + + none + + + Linux + + Indicates that the type of operating system is Linux. + + SwitchParameter + + SwitchParameter + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ProvisionVMAgent + + Indicates that the settings require that the virtual machine agent be installed on the virtual machine. + + SwitchParameter + + SwitchParameter + + + none + + + TimeZone + + Specifies the time zone for the virtual machine. + + System.String + + System.String + + + none + + + VM + + Specifies the local virtual machine object on which to set operating system properties. To obtain a virtual machine object, use the Get-AzureVM cmdlet. Create a virtual machine object by using the New-AzureVMConfig cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + Windows + + Indicates that the type of operating system is Windows. + + SwitchParameter + + SwitchParameter + + + none + + + WinRMCertificateUrl + + Specifies the URI of a WinRM certificate. This needs to be stored in a Key Vault. + + System.Uri + + System.Uri + + + none + + + WinRMHttp + + Indicates that this operating system uses HTTP WinRM. + + SwitchParameter + + SwitchParameter + + + none + + + WinRMHttps + + Indicates that this operating system uses HTTPS WinRM. + + SwitchParameter + + SwitchParameter + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Set operating system properties for a new virtual machines + + + + + PS C:\>$SecurePassword = ConvertTo-SecureString "password" -AsPlainText -Force +PS C:\> $Credential = New-Object System.Management.Automation.PSCredential ("FullerP", $SecurePassword); +PS C:\> $AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureVMConfig -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-AzureVMOperatingSystem -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-AzureVMOperatingSystem 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-AzureVM + + + + New-AzureVMConfig + + + + + + + Set-AzureVMOSDisk + + Sets the operating system disk properties on a virtual machine. + + + + + Set + AzureVMOSDisk + + + + The Set-AzureVMOSDisk cmdlet set the operating system disk properties on a virtual machine. + + + + Set-AzureVMOSDisk + + VM + + Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureVM 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: - # Virtual Machine Extension - $extname = 'csetest'; - $publisher = 'Microsoft.Compute'; - $exttype = 'CustomScriptExtension'; - $extver = '1.1'; +-- ReadOnly +-- ReadWrite - # Set extension settings by hash table - $settings = @{"fileUris" = "[]"; "commandToExecute" = ""}; - $protectedsettings = @{"storageAccountName" = $stoname; "storageAccountKey" = $stokey}; - Set-AzureVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -Publisher $publisher -Type $exttype -TypeHandlerVersion $extver -Settings $settings -ProtectedSettings $protectedsettings; - - - - - - - - - - - - - - - - -------------------------- Set Extension by String input -------------------------- - - PS C:\> - - PS C:\> $rgname = "RG1" - $loc = "West US" - $vmname = "myVM" +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. + + + ReadOnly + ReadWrite + + + + SourceImageUri + + + + This setting affects the consistency and performance of the disk. + + System.String + + + CreateOption + + Specifies whether this cmldet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. Valid values are: + +-- Attach +-- Empty +-- FromImage + This setting affects the consistency and performance of the disk. + + + empty + attach + fromImage + + + + Windows + + Indicates that the operating system on the user image is Windows. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + Set-AzureVMOSDisk + + VM + + Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureVM 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: - # Virtual Machine Extension - $extname = 'csetest'; - $publisher = 'Microsoft.Compute'; - $exttype = 'CustomScriptExtension'; - $extver = '1.1'; +-- 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. + + + ReadOnly + ReadWrite + + + + SourceImageUri + + + + This setting affects the consistency and performance of the disk. + + System.String + + + CreateOption + + Specifies whether this cmldet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. Valid values are: + +-- Attach +-- Empty +-- FromImage + This setting affects the consistency and performance of the disk. + + + empty + attach + fromImage + + + + Linux + + Indicates that the operating system on the user image is Linux. Specify this parameter for user image based virtual machine deployment. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + 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. + + String + + String + + + none + + + CreateOption + + Specifies whether this cmldet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. Valid values are: + +-- Attach +-- Empty +-- FromImage + This setting affects the consistency and performance of the disk. + + System.String + + System.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 + + + Name + + Specifies the name of the operating system disk. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + SourceImageUri + + + + This setting affects the consistency and performance of the disk. + + System.String + + System.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 + + + VM + + Specifies the local virtual machine object on which to set operating system disk properties. To obtain a virtual machine object, use the Get-AzureVM cmdlet. + + PSVirtualMachine + + PSVirtualMachine + + + none + + + Windows + + Indicates that the operating system on the user image is Windows. + + SwitchParameter + + SwitchParameter + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Sets properties on a virtual machine + + + + + PS C:\>$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> Set-AzureVMOSDisk -VM $VirtualMachine -Name "OsDisk02" -VhdUri "os.vhd" -Caching ReadWrite + + + 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 the properties on the virtual machine in $VirtualMachine. + + + + + + + + + + + + + Get-AzureVM + + + + Get-AzureAvailabilitySet + + + + New-AzureVMConfig + + + + + + + Set-AzureVMSourceImage + + Specifies the platform image for a virtual machine. + + + + + Set + AzureVMSourceImage + + + + The Set-AzureVMSourceImage cmdlet specifies the platform image to use for a virtual machine. + + + + Set-AzureVMSourceImage + + VM + + Specifies the local virtual machine object to configure. + + Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine + + + Name + + Specifies the name of a source image. + + System.String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + Set-AzureVMSourceImage + + VM + + Specifies the local virtual machine object to configure. + + Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine + + + PublisherName + + Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureVMImagePublisher cmdlet. + + System.String + + + Offer + + Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureVMImageOffer cmdlet. + + System.String + + + Skus + + Specfies a VMImage SKU. To obtain SKUs, use the Get-AzureVMImageSku cmdlet. + + System.String + + + Version + + Specifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. + + System.String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + + + + Name + + Specifies the name of a source image. + + System.String + + System.String + + + none + + + Offer + + Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureVMImageOffer cmdlet. + + System.String + + System.String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + Microsoft.Azure.Common.Authentication.Models.AzureProfile + + + none + + + PublisherName + + Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureVMImagePublisher cmdlet. + + System.String + + System.String + + + none + + + Skus + + Specfies a VMImage SKU. To obtain SKUs, use the Get-AzureVMImageSku cmdlet. + + System.String + + System.String + + + none + + + Version + + Specifies a version of a VMImage. To use the latest version, specify a value of latest instead of a particular version. + + System.String + + System.String + + + none + + + VM + + Specifies the local virtual machine object to configure. + + Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine + + Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Set values for an image + + + + + PS C:\>AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" +PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +PS C:\> Set-AzureVMSourceImage -VM $VirtualMachine -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Skus "2012-R2-Datacenter" -Version "latest" - # Set extension settings by raw strings - $settingstr = '{"fileUris":[],"commandToExecute":""}'; - $protectedsettingstr = '{"storageAccountName":"' + $stoname + '","storageAccountKey":"' + $stokey + '"}'; - Set-AzureVMExtension -ResourceGroupName $rgname -Location $loc -VMName $vmname -Name $extname -Publisher $publisher -Type $exttype -TypeHandlerVersion $extver -SettingString $settingstr -ProtectedSettingString $protectedsettingstr; - - - - - - - - - - - - - - - - - - + + + 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-AzureVMImagePublisher, Get-AzureVMImageOffer, Get-AzureVMImageSku, and Get-AzureVMImage cmdlets can discover these settings. + + + + + + + + + + + Example 2: Use the image reference method to set values + + + + + PS C:\>$Publisher = (Get-AzureVMImagePublisher -Location "Central US") | select -ExpandProperty PublisherName | where { $_ -like '*Microsoft*Windows*Server' } +PS C:\> $Offer = (Get-AzureVMImageOffer -Location "Central US" -PublisherName $Publisher[0]) | select -ExpandProperty Offer | where { $_ -like '*Windows*' } +PS C:\> $Sku = (Get-AzureVMImageSku -Location "Central US" -PublisherName $Publisher[0] -Offer $Offer[0]) | select -ExpandProperty Skus +PS C:\> $Versions = (Get-AzureVMImage -Location "Central US" -Offer -Offer $Offer[0] -PublisherName $Publisher[0] -Skus $Sku[0]) | select -ExpandProperty Version +PS C:\> $VMImage = Get-AzureVMImageDetail -Location "Central US" -Offer -Offer $Offer[0] -PublisherName $Publisher[0] -Skus $Sku[0] -Version $Versions[0] +PS C:\> $VirtualMachine07 = Set-AzureVMSourceImage -VM $VirtualMachine07 -ImageReference $VMImage + + + This example sets source image settings by using the image reference method. + + + + + + + + + + + + + Get-AzureAvailabilitySet + + + + New-AzureVMConfig + + + + Get-AzureVMImagePublisher + + + + Get-AzureVMImageOffer + + + + Get-AzureVMImageSku + + + + Get-AzureVMImage + + + + + + + Set-AzureVM + + Marks a virtual machine as generalized. + + + + + Set + AzureVM + + + + The Set-AzureVM 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-AzureVM + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + + 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. + + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Generalized + + Indicates that this cmdlet marks a virtual machine as generalized. + + SwitchParameter + + SwitchParameter + + + none + + + Name + + Specifies the name of the virtual machine on which this cmdlet operates. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of the resource group of the virtual machine. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Mark a virtual machine as generalized + + + + + PS C:\>Set-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized + + + This command marks the virtual machine named VirtualMachine07 as generalized. + + + + + + + + + + + + + Get-AzureVM + + + + + + + Start-AzureVM + + Starts an Azure virtual machine. + + + + + Start + AzureVM + + + + The Start-AzureVM cmdlet starts an Azure virtual machine. + + + + Start-AzureVM + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + Name + + Specifies the name of the virtual machine to start. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + + + + Name + + Specifies the name of the virtual machine to start. + + String + + String + + + none + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + AzureProfile + + + none + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + String + + + none + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example 1: Start a virtual machine + + + + + PS C:\>Start-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" + + + This command starts the virtual machine named VirtualMachine07 in ResourceGroup11. + + + + + + + + + + + + + Get-AzureVM + + + + New-AzureVM + + + + Remove-AzureVM + + + + Restart-AzureVM + + + + Stop-AzureVM + + + + Update-AzureVM + + + + - - Set-AzureVMDSCExtension - + Stop-AzureVM - Configure the Windows PowerShell Desired State Configuration extension on a VM. + Stops an Azure virtual machine. - + - Set - AzureVMDscExtension - + Stop + AzureVM + - Configure the Windows PowerShell Desired State Configuration extension on a VM in a resource group + The Stop-AzureVM cmdlet stops an Azure virtual machine. - - Set-AzureVMDSCExtension - - ArchiveBlobName - - The name of the configuration file that was previously uploaded by Publish-AzureVMDSCConfiguration - - string - - + Stop-AzureVM + ResourceGroupName - The name of the resource group that contains the virtual machine - - string - - - VMName - - Name of the virtual machine where dsc extension handler would be installed - - string - - - ArchiveStorageAccountName - - The Azure Storage Account name used to download the ArchiveBlobName - - string - - - Version - - The version of the DSC extension that Set-AzureVMDSCExtension will apply the settings to. Allowed format N.N - - string - - - ConfigurationArgument - - A hashtable specifying the arguments to the ConfigurationFunction - - hashtable - - - ConfigurationData - - Path to a .psd1 file that specifies the data for the Configuration - - string - - - ConfigurationName - - Name of the configuration that will be invoked by the DSC Extension - - string - - - ArchiveResourceGroupName - - The name of the resource group that contains the storage account containing the configuration archive.This param is optional if storage account and virtual machine both exists in the same resource group name, specified by ResourceGroupName param - - string - - - ArchiveContainerName - - Name of the Azure Storage Container where the configuration archive is located + Specifies the name of a resource group. - string - - - Force - - By default Set-AzureVMDscExtension will not overwrite any existing blobs. Use -Force to overwrite them - - - - Location - - Location of the resource - - string + String - + Name - Name of the DSC Extension handler. It will default to 'DSC' when it is not provided - - string - - - ArchiveStorageEndpointSuffix - - The Storage Endpoint Suffix + Specifies the name of the virtual machine to stop. - string + String - - AutoUpdate + + Force - We install the extension handler version specified by the -version param. By default extension handler is not autoupdated. Use -AutoUpdate to enable auto update of extension handler to the latest version as and when it is available. + Forces the command to run without asking for user confirmation. - - Confirm + + Profile - Prompts you for confirmation before executing the command. + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + AzureProfile - - WhatIf + + StayProvisioned - Describes what would happen if you executed the command without actually executing the command. + Indicates that this cmdlet uses the stay provisioned setting. - - - ArchiveBlobName - - The name of the configuration file that was previously uploaded by Publish-AzureVMDSCConfiguration - - string - - string - - - - - - ConfigurationArgument - - A hashtable specifying the arguments to the ConfigurationFunction - - hashtable - - hashtable - - - - - - ConfigurationData - - Path to a .psd1 file that specifies the data for the Configuration - - string - - string - - - - - - ConfigurationName - - Name of the configuration that will be invoked by the DSC Extension - - string - - string - - - - - - ArchiveContainerName - - Name of the Azure Storage Container where the configuration archive is located - - string - - string - - - - - + Force - By default Set-AzureVMDscExtension will not overwrite any existing blobs. Use -Force to overwrite them + Forces the command to run without asking for user confirmation. SwitchParameter SwitchParameter - + - + none - - Location + + Name - Location of the resource + Specifies the name of the virtual machine to stop. - string + String - string - + String + - + none - - Name + + Profile - Name of the DSC Extension handler. It will default to 'DSC' when it is not provided + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. - string + AzureProfile - string - + AzureProfile + - + none - + ResourceGroupName - The name of the resource group that contains the virtual machine + Specifies the name of a resource group. - string + String - string - + String + - + none - - ArchiveResourceGroupName + + StayProvisioned - The name of the resource group that contains the storage account containing the configuration archive. This param is optional if storage account and virtual machine both exists in the same resource group name,specified by ResourceGroupName param. + Indicates that this cmdlet uses the stay provisioned setting. - string + SwitchParameter - string - + SwitchParameter + - + none - - ArchiveStorageAccountName - - The Azure Storage Account name used to download the ArchiveBlobName - - string + + + - string - + + + + + + + - - - - ArchiveStorageEndpointSuffix - The Storage Endpoint Suffix + + - string + + + + - string - + + + + + + + - - - - Version - The version of the DSC extension that Set-AzureVMDSCExtension will apply the settings to. Allowed format N.N + + - string + + + + + + + Example 1: Stop a virtual machine + + + + + PS C:\>Stop-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" + + + This command stops the virtual machine named VirtualMachine07 in ResourceGroup11. + + + + + + + + + + + + + Get-AzureVM + + + + New-AzureVM + + + + Remove-AzureVM + + + + Restart-AzureVM + + + + Start-AzureVM + + + + Update-AzureVM + + + + + + + Update-AzureVM + + Updates the state of an Azure virtual machine. + + + + + Update + AzureVM + + + + The Update-AzureVM cmdlet updates the state of an Azure virtual machine to the state of a virtual machine object. + + + + Update-AzureVM + + Name + + Specifies the name of the virtual machine to update. + + String + + + Profile + + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. + + AzureProfile + + + Tags + + + + + System.Collections.Hashtable[] + + + ResourceGroupName + + Specifies the name of a resource group. + + String + + + VM + + Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureVM cmdlet. This virtual machine object contains the updated state for the virtual machine. + + PSVirtualMachine + + + + + + Name + + Specifies the name of the virtual machine to update. + + String - string - + String + - + none - - VMName + + Profile - Name of the virtual machine where dsc extension handler would be installed + Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile. - string + AzureProfile - string - + AzureProfile + - + none - - AutoUpdate + + ResourceGroupName - We install the extension handler version specified by the -version param. By default extension handler is not autoupdated. Use -AutoUpdate to enable auto update of extension handler to the latest version as and when it is available. - + Specifies the name of a resource group. - SwitchParameter + String - SwitchParameter - + String + - + none - - Confirm + + Tags - Prompts you for confirmation before executing the command. + + - SwitchParameter + System.Collections.Hashtable[] - SwitchParameter + System.Collections.Hashtable[] - + none - - WhatIf + + VM - Describes what would happen if you executed the command without actually executing the command. + Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureVM cmdlet. This virtual machine object contains the updated state for the virtual machine. - SwitchParameter + PSVirtualMachine - SwitchParameter + PSVirtualMachine - + none - - - - + + + + + + + - @@ -11057,125 +17381,75 @@ Set-AzureVMCustomScriptExtension -ResourceGroupName $rgname -Location $loc -VMNa - - - + + + + + + + - - - - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - + Example 1: Update a virtual machine - C:\PS> - - - Set-AzureVMDscExtension -ResourceGroupName name -VMName vm -ArchiveBlobName Sample.ps1.zip -ArchiveStorageAccountName stg -ConfigurationName MyConfiguration -Version 1.10 -Location 'West US' - - - Description - ----------- - Set the extension on the VM to download MyConfiguration.ps1 from the default container (windows-powershell-dsc) - and invoke configuration MyConfiguration with arguments to the configuration function. Connect to blob storage using the value of - $ENV:azure_storage_connection_string - - - - - - - - - - - - - - - -------------------------- EXAMPLE 2 -------------------------- - - - C:\PS> - - - Set-AzureVMDscExtension -ResourceGroupName name -VMName vm -ArchiveBlobName Sample.ps1.zip -ArchiveStorageAccountName stg -ConfigurationName name -ConfigurationArgument @{arg="val"} -ArchiveContainerName WindowsPowerShellDSC -ConfigurationData SampleData.psd1 -Version 1.10 -Location 'West US' - - - Description - ----------- - With arguments to the configuration function - - - - - - - - - - - - - - - -------------------------- EXAMPLE 3 -------------------------- - - - C:\PS> - - Set-AzureVMDscExtension -ResourceGroupName name -VMName vm -ArchiveBlobName Sample.ps1.zip -ArchiveStorageAccountName stg -ConfigurationName name -ConfigurationArgument @{arg="val"} -ArchiveContainerName WindowsPowerShellDSC -ConfigurationData SampleData.psd1 -Version 1.10 -Location 'West US' -AutoUpdate - + PS C:\>Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine + - Description - ----------- - Enable -AutoUpdate - - - - + 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-AzureVM cmdlet. + + - + - - - + Get-AzureVM + + + + New-AzureVM + + + + Remove-AzureVM + + + + Restart-AzureVM + + + + Start-AzureVM + + + + Stop-AzureVM + + + + New-AzureVMConfig + - +======= Set-AzureVMOperatingSystem @@ -11710,7 +17984,7 @@ $vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -C For Image based VM Creation – Specifies the VHD file that needs to be created when a platform image or user image is specified. This is where the image blob will be copied to start the VM from. Example: http://contoso.blob.core.windows.net/System/ComputeVM/myImage/mydisk.vhd - + For Disk based VM Boot scenario – Specifies the VHD file that needs to be used directly (without copy) for booting up the VM. Applies to both OS and Data Disks. @@ -11792,7 +18066,7 @@ $vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -C For Image based VM Creation – Specifies the VHD file that needs to be created when a platform image or user image is specified. This is where the image blob will be copied to start the VM from. Example: http://contoso.blob.core.windows.net/System/ComputeVM/myImage/mydisk.vhd - + For Disk based VM Boot scenario – Specifies the VHD file that needs to be used directly (without copy) for booting up the VM. Applies to both OS and Data Disks. @@ -11884,7 +18158,7 @@ $vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -C For Image based VM Creation – Specifies the VHD file that needs to be created when a platform image or user image is specified. This is where the image blob will be copied to start the VM from. Example: http://contoso.blob.core.windows.net/System/ComputeVM/myImage/mydisk.vhd - + For Disk based VM Boot scenario – Specifies the VHD file that needs to be used directly (without copy) for booting up the VM. Applies to both OS and Data Disks. @@ -13040,4 +19314,5 @@ Set-AzureVMSourceImage -VM $vm -Name $img -DestinationVhdsContainer $vhdContaine +>>>>>>> 648c7babd1ebd26be6b156ee710c27906938c4fe