diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index 10735f2cdd7e..f31e479554e9 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -1942,6 +1942,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5273,6 +5341,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln index be16f572311e..e1c922db7dd8 100644 --- a/src/AzurePowershell.sln +++ b/src/AzurePowershell.sln @@ -232,6 +232,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HDInsight", "ServiceManagement\HDInsight\Commands.HDInsight\HDInsight.csproj", "{137D404A-865A-43DB-930C-6DA67DA048DF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight", "ResourceManager\HDInsight\Commands.HDInsight\Commands.HDInsight.csproj", "{6B7540C5-8AB3-4011-864B-0BE76F282F9E}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery", "ResourceManager\SiteRecovery\Commands.SiteRecovery\Commands.SiteRecovery.csproj", "{7C879645-31EE-4A78-AD81-5512300FA104}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery.Test", "ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\Commands.SiteRecovery.Test.csproj", "{6C7D3D81-37AB-445E-8081-78A1FEC0A773}" 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 2414cbd7f060..f9d642850ebd 100644 --- a/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml +++ b/src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml @@ -1,8186 +1,6 @@ - - - - - Add-AzureVMAdditionalUnattendContent - - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - - - - - Add - AzureVMAdditionalUnattendContent - - - - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - - - - Add-AzureVMAdditionalUnattendContent - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - - Content - - Specifies the base-64 encoded XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less that 4 KB and must include the root element for the setting or feature that is being inserted. - - String - - - SettingName - - Specifies the name of the setting to which the content applies. - Possible values are: - FirstLogonCommands - AutoLogon - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - Content - - Specifies the base-64 encoded XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less that 4 KB and must include the root element for the setting or feature that is being inserted. - - String - - String - - - - - - SettingName - - Specifies the name of the setting to which the content applies. - Possible values are: - FirstLogonCommands - AutoLogon - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $vm = New-AzureVMConfig -VMName $vmname -VMSize $vmsize; - -$vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -Credential $cred - -$aucSetting = "AutoLogon"; -$aucContent = "<UserAccounts><AdministratorPassword><Value>" + $password + "</Value><PlainText>true</PlainText></AdministratorPassword></UserAccounts>"; - -$vm = Add-AzureVMAdditionalUnattendContentConfig -VM $vm -Content $aucContent -SettingName $aucSetting; - - - - - - - - - - - - - - - - - - - - - - Add-AzureVMDataDisk - - Add Data Disk to VM - - - - - Add - AzureVMDataDisk - - - - This cmdlets allows you to add a Data Disk to the VM at creation time or to an existing VM - - - - Add-AzureVMDataDisk - - VM - - Local VM Object to add the Data Disk to. The local VM object can be created with New-AzureVMConfig cmdlet or gotten through the Get-AzureVM cmdlet. - - PSVirtualMachine - - - Name - - Name of the Data Disk - - String - - - VhdUri - - Specifies the VHD file that needs to be created when a platform image or user image is used. This is where the image blob will be copied to start the VM from. - - String - - - Caching - - Specifies the caching mode of the disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. - Possible values are: - • ReadOnly - • ReadWrite - The default value is ReadWrite. - - String - - - DiskSizeInGB - - Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. - - Nullable`1[Int32] - - - Lun - - Specifies the Logical Unit Number (LUN) for the data disk. If the disk is the first disk that is added, this element is optional and the default value of 0 is used. If more than one disk is being added, this element is required. - - Nullable`1[Int32] - - - CreateOption - - Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are - "FromImage”, “Attach” or “Empty” - - String - - - SourceImageUri - - Uri of the existing VHD in case attaching the disk to the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Local VM Object to add the Data Disk to. The local VM object can be created with New-AzureVMConfig cmdlet or gotten through the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - Name - - Name of the Data Disk - - String - - String - - - - - - VhdUri - - Specifies the VHD file that needs to be created when a platform image or user image is used. This is where the image blob will be copied to start the VM from. - - String - - String - - - - - - Caching - - Specifies the caching mode of the disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. - Possible values are: - • ReadOnly - • ReadWrite - The default value is ReadWrite. - - String - - String - - - - - - DiskSizeInGB - - Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - Lun - - Specifies the Logical Unit Number (LUN) for the data disk. If the disk is the first disk that is added, this element is optional and the default value of 0 is used. If more than one disk is being added, this element is required. - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - CreateOption - - Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are - "FromImage”, “Attach” or “Empty” - - String - - String - - - - - - SourceImageUri - - Uri of the existing VHD in case attaching the disk to the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Add Data Disk to a new VM -------------------------- - - PS C:\> - - # Create the local VM Object -$vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -AvailabilitySetID $as1.Id - -$stoname = 'teststo'; -$stotype = 'Standard_GRS'; - -$osDiskName = 'osDisk'; -$osDiskCaching = 'ReadWrite'; -$osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd"; - -$dataDiskVhdUri1 = "https://$stoname.blob.core.windows.net/test/data1.vhd"; -$dataDiskVhdUri2 = "https://$stoname.blob.core.windows.net/test/data2.vhd"; -$dataDiskVhdUri3 = "https://$stoname.blob.core.windows.net/test/data3.vhd"; - -# Add Data Disks to this VM -$vm = Add-AzureVMDataDisk -VM $vm -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $dataDiskVhdUri1 -CreateOption Empty; -$vm = Add-AzureVMDataDisk -VM $vm -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $dataDiskVhdUri2 -CreateOption Empty; -$vm = Add-AzureVMDataDisk -VM $vm -Name 'testDataDisk3' -Caching 'ReadOnly' -DiskSizeInGB 12 -Lun 2 -VhdUri $dataDiskVhdUri3 -CreateOption Empty; - - - - - - - - - - - - - - - - -------------------------- Add a Data Disk to an existing VM -------------------------- - - PS C:\> - - # Get the VM -$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - -# Add Data Disk disk1 to VM -Add-AzureVMDataDisk –VM $vm –Name "disk1" –VhdUri "http://storageaccountname.blob.core.windows.net/vhds/test2.vhd" –LUN 0 –Caching ReadOnly –DiskSizeinGB 1 -CreateOption Empty; - -# Update VM state -Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm - - - - - - - - - - - - - - - - - - - - - - Add-AzureVMNetworkInterface - - Add a Network Interface to the VM - - - - - Add - AzureVMNetworkInterface - - - - This cmdlets allows you to add a NIC to the VM at creation time or to an existing VM - - - - Add-AzureVMNetworkInterface - - VM - - Local VM Object to add the Network Interface to. The local VM object can be created with New-AzureVMConfig cmdlet or gotten through the Get-AzureVM cmdlet. - - PSVirtualMachine - - - Id - - Id of the Network Interface. This can be gotten using the Get-AzureNetworkInterface cmdlet. - - String - - - Primary - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Local VM Object to add the Network Interface to. The local VM object can be created with New-AzureVMConfig cmdlet or gotten through the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - Id - - Id of the Network Interface. This can be gotten using the Get-AzureNetworkInterface cmdlet. - - String - - String - - - - - - Primary - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Add a Network Interface to a new VM -------------------------- - - PS C:\> - - # Get the VM -$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM - -# Add a Network Interface to the VM -Add-AzureVMNetworkInterface –VM $vm –Id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/NetworkAdapters/Nic1" - - - - - - - - - - - - - - - - -------------------------- Add a Network Interface to an existing VM -------------------------- - - PS C:\> - - # Get the VM -$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - -# Add a Network Interface to the VM -Add-AzureVMNetworkInterface –VM $vm –Id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/NetworkAdapters/Nic1" - -# Update VM state -Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm - - - - - - - - - - - - - - - - - - - - - - Add-AzureVMSecret - - Add a secret to the VM which allows you to place a certificate on the VM - - - - - Add - AzureVMSecret - - - - Add a secret to the VM which allows you to place a certificate on the VM - - - - Add-AzureVMSecret - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - - SourceVaultId - - Resource Id of the Key Vault which contains the certificates to place on the VM. Also acts as the key for adding multiple certificates i.e. use the same SourceVaultId when adding multiple certificates from the same KeyVault - - String - - - CertificateStore - - Name of the certificate store on the Windows VM the certificate should be added to - - String - - - CertificateUrl - - A KeyVault Url pointing to a KeyVault secret which contains a certificate formatted as follows - It is the Base64 encoding of the following JSON Object which is encoded in UTF-8 - { - “data”:”<Base64-encoded-file>”, - “dataType” :”<file-format>”, - “password”:”<pfx-file-password>” -} - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - SourceVaultId - - Resource Id of the Key Vault which contains the certificates to place on the VM. Also acts as the key for adding multiple certificates i.e. use the same SourceVaultId when adding multiple certificates from the same KeyVault - - String - - String - - - - - - CertificateStore - - Name of the certificate store on the Windows VM the certificate should be added to - - String - - String - - - - - - CertificateUrl - - A KeyVault Url pointing to a KeyVault secret which contains a certificate formatted as follows - It is the Base64 encoding of the following JSON Object which is encoded in UTF-8 - { - “data”:”<Base64-encoded-file>”, - “dataType” :”<file-format>”, - “password”:”<pfx-file-password>” -} - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $vm = New-AzureVMConfig -VMName $vmname -VMSize $vmsize; - -$vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -Credential $cred - -$SourceVaultId = "/subscriptions/" + $subid + "/resourceGroups/RgTest1/providers/Microsoft.KeyVault/vaults/TestVault123"; -$certStore = "My"; -$certUrl = "https://testvault123.vault.azure.net/secrets/Test1/514ceb769c984379a7e0230bdd703272"; -$vm = Add-AzureVMSecret -VM $vm -SourceVaultId $SourceVaultId -CertificateStore $certStore -CertificateUrl $certUrl; - -$SourceVaultId2 = "/subscriptions/" + $subid + "/resourceGroups/RgTest1/providers/Microsoft.KeyVault/vaults/TestVault456"; -$vm = Add-AzureVMSecret -VM $vm -SourceVaultId $SourceVaultId2 -CertificateStore $certStore -CertificateUrl $certUrl; - -$certStore2 = "My2"; -$certUrl2 = "https://testvault123.vault.azure.net/secrets/Test1/514ceb769c984379a7e0230bddaaaaaa"; -$vm = Add-AzureVMSecret -VM $vm -SourceVaultId $SourceVaultId -CertificateStore $certStore2 -CertificateUrl $certUrl2; - - - - - - - - - - - - - - - - - - - - - - Add-AzureVMSshPublicKey - - Specifies the SSH public keys to use with the Virtual Machine. - - - - - Add - AzureVMSshPublicKey - - - - Specifies the SSH public keys to use with the Virtual Machine. - - - - Add-AzureVMSshPublicKey - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - - KeyData - - Specifies a base-64 encoding of the public key used to SSH into the Virtual Machine. - - String - - - Path - - Specifies the full path of a file, on the Virtual Machine, where the SSH public key is stored. If the file already exists, the specified key is appended to the file. -Example: -/home/user/.ssh/authorized_keys - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - VM object to modify. Create one using New-AzureVMConfig cmdlet or Get one using the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - KeyData - - Specifies a base-64 encoding of the public key used to SSH into the Virtual Machine. - - String - - String - - - - - - Path - - Specifies the full path of a file, on the Virtual Machine, where the SSH public key is stored. If the file already exists, the specified key is appended to the file. -Example: -/home/user/.ssh/authorized_keys - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $sshPath = "/home/testuser/.ssh/authorized_keys"; -$sshPublicKey = "MIIDszCCApugAwIBAgIJALBV9YJCF/tAMA0GCSq12Ib3DQEB21QUAMEUxCzAJBgNV"; -$vm = Add-AzureVMSshPublicKey -VM $vm -KeyData $sshPublicKey -Path $sshPath; -$vm = Add-AzureVMSshPublicKey -VM $vm -KeyData $sshPublicKey -Path $sshPath; - - - - - - - - - - - - - - - - - - - - - - Get-AzureAvailabilitySet - - Get Availability Set properties - - - - - Get - AzureAvailabilitySet - - - - This cmdlet allows you to discover information about a specified Availability Set or all Availability Sets within a Resource Group - - - - Get-AzureAvailabilitySet - - ResourceGroupName - - Name of the Resource Group containing the Avaialbility Set - - String - - - Name - - Name of the Availability Set - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group containing the Avaialbility Set - - String - - String - - - - - - Name - - Name of the Availability Set - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Get information about a specified Availability Set -------------------------- - - PS C:\> - - Get-AzureAvailabilitySet –ResourceGroupName “RG1” –Name “MyASet” - - - - - - - - - - - - - - - - -------------------------- Get information about all Availability Sets within a Resource Group -------------------------- - - PS C:\> - - Get-AzureAvailabilitySet –ResourceGroupName “RG1” - - - - - - - - - - - - - - - - - - - - - - Get-AzureRemoteDesktopFile - - Get the Remote Desktop file for the VM - - - - - Get - AzureRemoteDesktopFile - - - - Get the Remote Desktop file for the VM - - - - Get-AzureRemoteDesktopFile - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - - Name - - Name of the VM - - String - - - LocalPath - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - LocalPath - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get-AzureStorageAccount - - Get the properties of a Storage Account - - - - - Get - AzureStorageAccount - - - - This cmdlet allows you to get the properties of a specified Storage Account or all Storage Accounts within a Resource Group or the subscription. - - - - Get-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the Storage Account - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Get a specified storage account -------------------------- - - PS C:\> - - PS C:\> #Get one storage account - Get-AzureStorageAccount -ResourceGroupName "RG1" -AccountName "myStorageAccount" - - - - - - - - - - - - - - - - -------------------------- Get all Storage Accounts in a Resource Group -------------------------- - - PS C:\> - - PS C:\> # Get all Storage Accounts in a Resource Group - Get-AzureStorageAccount -ResourceGroupName "RG1" - - - - - - - - - - - - - - - - -------------------------- Get all Storage Accounts in the subscription -------------------------- - - PS C:\> - - PS C:\> # Get all Storage Accounts in the subscription - Get-AzureStorageAccount - - - - - - - - - - - - - - - - - - - - - - Get-AzureStorageAccountKey - - Get the access keys for an Azure storage account - - - - - Get - AzureStorageAccountKey - - - - This cmdlet allows you to get the access keys for an Azure storage account. - - - - Get-AzureStorageAccountKey - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the Storage Account - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Get the access keys for a Storage Account -------------------------- - - PS C:\> - - #Get keys - Get-AzureStorageAccountKey -ResourceGroupName "RG1" -AccountName "myStorageAccount" - - - - - - - - - - - - - - - - - - - - - - Get-AzureVM - - Get the properties of a VM or Get all VMs in a subscription - - - - - Get - AzureVM - - - - This cmdlet allows you to get the model or instance view of the VM. By default the returned VM object contains the model view. If you'd like to see the instance view of a VM use the -Status switch. - This cmdlet also allows you to get information about all VMs in your subscription if no parameters are used. - - - - Get-AzureVM - - All - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the VM - - String - - - Status - - Allows you to only return the Instance View - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureVM - - NextLink - - - - Uri - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - All - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Status - - Allows you to only return the Instance View - - SwitchParameter - - SwitchParameter - - - - - - NextLink - - - - Uri - - Uri - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Get the properties of a VM -------------------------- - - PS C:\> - - # Get the VM -$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - - - - - - - - - - - - - - - -------------------------- Get only the status of VM -------------------------- - - PS C:\> - - Get the VM instance view -$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" -Status - - - - - - - - - - - - - - - - -------------------------- Get all VMs in a Resource Group -------------------------- - - PS C:\> - - # Get all VMs in a Resource Group -$vm = Get-AzureVM -ResourceGroupName "myRG" - - - - - - - - - - - - - - - - -------------------------- Get all VMs in your subscription -------------------------- - - PS C:\> - - # Get all VMs in your subscription -Get-AzureVM - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMAccessExtension - - Get the information about VMAccess extension - - - - - Get - AzureVMAccessExtension - - - - Get the information about VMAccess extension - - - - Get-AzureVMAccessExtension - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension - - String - - - Status - - Get the instance view of the extension - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the extension - - String - - String - - - - - - Status - - Get the instance view of the extension - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - # Get VM Extension -$ext = Get-AzureVMAccessExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname; - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - # Get VM Extension Status -$ext = Get-AzureVMAccessExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname -Status; - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMCustomScriptExtension - - Get the information about Custom Script extension - - - - - Get - AzureVMCustomScriptExtension - - - - Get the information about Custom Script extension - - - - Get-AzureVMCustomScriptExtension - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension - - String - - - Status - - Get the instance view of the extension - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the extension - - String - - String - - - - - - Status - - Get the instance view of the extension - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - # Get VM Extension -$ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname; - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - # Get VM Extension Status -$ext = Get-AzureVMCustomScriptExtension -ResourceGroupName $rgname -VMName $vmname -Name $extname -Status; - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMDscExtension - - - Gets the settings of the DSC extension on a particular VM - - - - - Get - AzureVMDscExtension - - - - Gets the settings of the DSC extension on a particular VM. - - - - - Get-AzureVMDscExtension - - ResourceGroupName - - The resource group name. - - string - - - VMName - - The virtual machine name - - string - - - Name - - Name of the Extension. This is defaulted to 'Microsoft.Powershell.DSC' - - String - - - Status - - Output shows status when the switch is present - - - - - - - - ResourceGroupName - - The resource group name. - - - string - - string - - - - - - VMName - - The virtual machine name - - - string - - string - - - - - - Name - - Name of the Extension. This is defaulted to 'Microsoft.Powershell.DSC' - - String - - String - - - - - - Status - - Output shows status when the switch is present - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - Microsoft.Azure.Commands.Compute.Extension.DSC.VirtualMachineDscExtensionContext - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Publish-AzureVMDscConfiguration - - Uploads a Desired State Configuration script to Azure blob storage, which later can be applied to Azure Virtual Machines using the Set-AzureVMDscExtension cmdlet. - - - - - Publish - AzureVMDscConfiguration - - - - - Uploads a Desired State Configuration script to Azure blob storage, which later can be applied to Azure Virtual Machines using the Set-AzureVMDscExtension cmdlet. - - - - Publish-AzureVMDscConfiguration - - ResourceGroupName - - The name of the resource group that contains the storage account. - - string - - - ConfigurationPath - - Path to a file containing one or more configurations. The file can be a PowerShell script (.ps1 file), module (.psm1 file), or an archive (.zip file) containing a set of PowerShell modules, each module in a separate directory. - - String - - - ContainerName - - Name of the Azure Storage Container the configuration is uploaded to. - - String - - - Force - - By default Publish-AzureVMDscConfiguration will not overwrite any existing blobs or files. Use -Force to overwrite them. - - SwitchParameter - - - StorageAccountName - - The Azure Storage Account name used to upload the configuration script to the container specified by ContainerName. - - String - - - StorageEndpointSuffix - - Suffix for the storage end point, e.g. core.windows.net - - string - - - WhatIf - - Describes what would happen if you executed the command without actually executing the command. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before executing the command. - - SwitchParameter - - - - Publish-AzureVMDscConfiguration - - ConfigurationPath - - Path to a file containing one or more configurations. The file can be a PowerShell script (.ps1 file), module (.psm1 file), or an archive (.zip file) containing a set of PowerShell modules, each module in a separate directory. - - String - - - Force - - By default Publish-AzureVMDscConfiguration will not overwrite any existing blobs or files. Use -Force to overwrite them. - - SwitchParameter - - - OutputArchivePath - - Path to a local ZIP file to write the configuration archive to. -When this parameter is used, the configuration script is not uploaded to Azure blob storage. - - String - - - WhatIf - - Describes what would happen if you executed the command without actually executing the command. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before executing the command. - - SwitchParameter - - - - - - ResourceGroupName - - The name of the resource group that contains the storage account - - string - - - ConfigurationPath - - Path to a file containing one or more configurations. The file can be a PowerShell script (.ps1 file), module (.psm1 file), or an archive (.zip file) containing a set of PowerShell modules, each module in a separate directory. - - String - - String - - - - - - ContainerName - - Name of the Azure Storage Container the configuration is uploaded to. - - String - - String - - - windows-powershell-dsc - - - Force - - By default Publish-AzureVMDscConfiguration will not overwrite any existing blobs or files. Use -Force to overwrite them. - - SwitchParameter - - SwitchParameter - - - - - - StorageAccountName - - The Azure Storage Account name used to upload the configuration script to the container specified by ContainerName. - - String - - String - - - - - - StorageEndpointSuffix - - Suffix for the storage end point, e.g. core.windows.net - - string - - string - - - - - - WhatIf - - Describes what would happen if you executed the command without actually executing the command. - - SwitchParameter - - SwitchParameter - - - - - - Confirm - - Prompts you for confirmation before executing the command. - - SwitchParameter - - SwitchParameter - - - - - - OutputArchivePath - - Path to a local ZIP file to write the configuration archive to. -When this parameter is used, the configuration script is not uploaded to Azure blob storage. - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - - - - PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1 -ResourceGroupName grpname -StorageAccountName strgAcctName - - Description - - - - -----------This command creates a ZIP package for the given script and any dependent resource modules and uploads it to Azure Storage. -By default the command does no produce any output; use the -Verbose option to display an indication of the operations performed by the command - - - - - -------------------------- EXAMPLE 2 -------------------------- - - - - PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1 -OutputArchivePath .\MyConfiguration.ps1.zip - - Description - - - - -----------This command creates a ZIP package for the given script and any dependent resource modules and stores it in the local file .\MyConfiguration.ps1.zip. - - - - - - - Unknown - - - - - - - - Get-AzureVMExtension - - Get the extensions installed on the VM - - - - - Get - AzureVMExtension - - - - Get properties about the extensions installed on a VM. To get only the instance view of the extensions use the -Status switch. - - - - Get-AzureVMExtension - - ResourceGroupName - - Name of the Resource Group - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the Extension - - String - - - Status - - Return only the status view of the Extension - - SwitchParameter - - - 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 - - - - - - Status - - Return only the status view of the Extension - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Get the properties of an extension -------------------------- - - PS C:\> - - Get-AzureVMExtension -ResourceGroupName "RG1" -VMName "crpVM" -Name "testext" - - - - - - - - - - - - - - - - -------------------------- Get the status view of an extension -------------------------- - - PS C:\> - - Get-AzureVMExtension -ResourceGroupName "RG1" -VMName "crpVM" -Name "testext" -Status - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMExtensionImage - - Get all versions for a particular extension - - - - - Get - AzureVMExtensionImage - - - - Get all versions for a particular extension - - - - Get-AzureVMExtensionImage - - Location - - Location of the extension - - String - - - PublisherName - - Name of extension publisher - - String - - - Type - - Type of the extension - - String - - - FilterExpression - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the extension - - String - - String - - - - - - PublisherName - - Name of extension publisher - - String - - String - - - - - - Type - - Type of the extension - - String - - String - - - - - - FilterExpression - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Version - - Version of the extension - - string - - string - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMExtensionImage -Location eastus -PublisherName Symantec -Type SymantecEndpointProtection - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMExtensionImageDetail - - Get the details on a specific extension - - - - - Get - AzureVMExtensionImageDetail - - - - Get the details on a specific extension - - - - Get-AzureVMExtensionImageDetail - - Location - - Location of the extension - - String - - - PublisherName - - Name of the extension publisher - - String - - - Type - - Type of the extension - - String - - - Version - - Version of the extension - - String - - - FilterExpression - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the extension - - String - - String - - - - - - PublisherName - - Name of the extension publisher - - String - - String - - - - - - Type - - Type of the extension - - String - - String - - - - - - Version - - Version of the extension - - String - - String - - - - - - FilterExpression - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMExtensionImageDetail -Location eastus -PublisherName Symantec -Type SymantecEndpointProtection -Version 12.1.4100.2 - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMExtensionImageType - - Get the type of the Azure extension - - - - - Get - AzureVMExtensionImageType - - - - Get the type of the Azure extension - - - - Get-AzureVMExtensionImageType - - Location - - Location of the Extension - - String - - - PublisherName - - Name of the extension publisher - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the Extension - - String - - String - - - - - - PublisherName - - Name of the extension publisher - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMExtensionImageType -Location eastus -PublisherName Symantec - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMImage - - Get all the versions of a VMImage - - - - - Get - AzureVMImage - - - - Get all the versions of a VMImage - - - - Get-AzureVMImage - - Location - - Location of the VMImage - - String - - - PublisherName - - Publisher of the VMImage. Use the Get-AzureVMImagePublisher cmdlet to get the values for this parameter. - - String - - - Offer - - Type of VMImage offer. Use the Get-AzureVMImageOffer cmdlet to get the values for this parameter. - - String - - - Skus - - VMImage SKU. Use the Get-AzureVMImageSku cmdlet to get the value of this parameter. - - String - - - FilterExpression - - - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the VMImage - - String - - String - - - - - - PublisherName - - Publisher of the VMImage. Use the Get-AzureVMImagePublisher cmdlet to get the values for this parameter. - - String - - String - - - - - - Offer - - Type of VMImage offer. Use the Get-AzureVMImageOffer cmdlet to get the values for this parameter. - - String - - String - - - - - - Skus - - VMImage SKU. Use the Get-AzureVMImageSku cmdlet to get the value of this parameter. - - String - - String - - - - - - FilterExpression - - - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Version - - - - string - - string - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMImage -Location eastus -PublisherName Canonical -Offer UbuntuServer -Skus 15.04-DAILY - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMImageDetail - - Returns information about a VMImage - - - - - Get - AzureVMImageDetail - - - - Returns information about a VMImage - - - - Get-AzureVMImageDetail - - Location - - Location of the VMImage - - String - - - PublisherName - - Name of the VMImage publisher - - String - - - Offer - - Type of VMImage offer - - String - - - Skus - - Type of VMImage SKU - - String - - - Version - - Version of VMImage - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the VMImage - - String - - String - - - - - - PublisherName - - Name of the VMImage publisher - - String - - String - - - - - - Offer - - Type of VMImage offer - - String - - String - - - - - - Skus - - Type of VMImage SKU - - String - - String - - - - - - Version - - Version of VMImage - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMImageDetail -Location eastus -PublisherName Canonical -Offer UbuntuServer -Skus 15.04-DAILY -Version 15.04.20150422 - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMImageOffer - - Returns the VMImage Offer types - - - - - Get - AzureVMImageOffer - - - - Returns the VMImage Offer types - - - - Get-AzureVMImageOffer - - Location - - Location for the images - - String - - - PublisherName - - Name of the Publisher - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location for the images - - String - - String - - - - - - PublisherName - - Name of the Publisher - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMImageOffer -Location eastus -PublisherName Canonical - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMImagePublisher - - Return the VMImage publishers - - - - - Get - AzureVMImagePublisher - - - - Return the VMImage publishers - - - - Get-AzureVMImagePublisher - - Location - - Location of the VMImage - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the VMImage - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMImagePublisher -Location eastus - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMImageSku - - Returns VMImage SKUs - - - - - Get - AzureVMImageSku - - - - Returns VMImage SKUs - - - - Get-AzureVMImageSku - - Location - - Location of the VMImage - - String - - - PublisherName - - Name of the Publisher - - String - - - Offer - - Type of VMImage offer - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the VMImage - - String - - String - - - - - - PublisherName - - Name of the Publisher - - String - - String - - - - - - Offer - - Type of VMImage offer - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMImageSku -Location eastus -PublisherName Canonical -Offer UbuntuServer - - - - - - - - - - - - - - - - - - - - - - Get-AzureVMSize - - Get the available VM sizes by location, Availability Set or resize an existing VM to - - - - - Get - AzureVMSize - - - - Get the available VM sizes by location, Availability Set or resize an existing VM to - - - - Get-AzureVMSize - - Location - - Location of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureVMSize - - ResourceGroupName - - Resource Group of the VM - - String - - - AvailabilitySetName - - Name of the Availability Set - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Get-AzureVMSize - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - AvailabilitySetName - - Name of the Availability Set - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMSize -Location westeurope - - Get the available VM sizes in a location - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - Get-AzureVMSize -ResourceGroupName rg3-AvailabilitySetName av3 - - Get available VM sizes you can deploy in an existing availability set - - - - - - - - - - - - - - -------------------------- Example 3 -------------------------- - - PS C:\> - - Get-AzureVMSize -ResourceGroupName rg3 -VMName vm3 - - Available VM sizes that an existing VM can be resized to - - - - - - - - - - - - - - - - - - - - Get-AzureVMUsage - - Get the VM core count usage in a location - - - - - Get - AzureVMUsage - - - - Get the VM core count usage in a location - - - - Get-AzureVMUsage - - Location - - Location to get VM core count usage in - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - Location - - Location to get VM core count usage in - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Get-AzureVMUsage -Location eastus - - - - - - - - - - - - - - - - - - - - - - New-AzureAvailabilitySet - - Create an Availability Set - - - - - New - AzureAvailabilitySet - - - - This cmdlet allows you to create an Availability Set - - - - New-AzureAvailabilitySet - - ResourceGroupName - - Name of Resource Group - - String - - - Name - - Name of Availability Set - - String - - - Location - - Location of the Availability Set - - String - - - PlatformUpdateDomainCount - - - - Nullable`1[Int32] - - - PlatformFaultDomainCount - - - - Nullable`1[Int32] - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of Resource Group - - String - - String - - - - - - Name - - Name of Availability Set - - String - - String - - - - - - Location - - Location of the Availability Set - - String - - String - - - - - - PlatformUpdateDomainCount - - - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - PlatformFaultDomainCount - - - - Nullable`1[Int32] - - Nullable`1[Int32] - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Create an Availability Set -------------------------- - - PS C:\> - - New-AzureAvailabilitySet -ResourceGroupName "RG1" -Name "myASet" -Location "West US" - - - - - - - - - - - - - - - - - - - - - - New-AzureStorageAccount - - Allows you to create a new Storage Account - - - - - New - AzureStorageAccount - - - - This cmdlet allows you to create a new Storage Account. - - - - New-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Storage Account - - String - - - Type - - Type of Storage Account. Valid values are -• Standard_LRS (Locally-redundant storage) -• Standard_ZRS (Zone-redundant storage) -• Standard_GRS (Geo-redundant storage) -• Standard_RAGRS (Read access geo-redundant storage) - - String - - - Location - - Location of the Storage Account - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the Storage Account - - String - - String - - - - - - Type - - Type of Storage Account. Valid values are -• Standard_LRS (Locally-redundant storage) -• Standard_ZRS (Zone-redundant storage) -• Standard_GRS (Geo-redundant storage) -• Standard_RAGRS (Read access geo-redundant storage) - - String - - String - - - - - - Location - - Location of the Storage Account - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - New-AzureStorageAccount -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -Location "US West" -AccountType "Standard_GRS" - - - - - - - - - - - - - - - - - - - - - - New-AzureStorageAccountKey - - Regenerates a storage key for an Azure storage account. - - - - - New - AzureStorageAccountKey - - - - Regenerates a storage key for an Azure storage account. - - - - New-AzureStorageAccountKey - - ResourceGroupName - - Name of the Resource Group the storage account is in - - String - - - Name - - Name of the Storage Account - - String - - - KeyName - - Specifies which key to regenerate. Supported value set: -- “key1” -- “key2” - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group the storage account is in - - String - - String - - - - - - Name - - Name of the Storage Account - - String - - String - - - - - - KeyName - - Specifies which key to regenerate. Supported value set: -- “key1” -- “key2” - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - #Regenerate a key -New-AzureStorageKey -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount" -keyName "key1" - - - - - - - - - - - - - - - - - - - - - - New-AzureVM - - Create a new VM - - - - - New - AzureVM - - - - This cmdlet allows you to create a new VM in Azure. This cmdlet takes a VM object as input which can be created using the New-AzureVMConfig cmdlet. The VM object must then be configured correctly using appropriate cmdlets such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Set-AzureVMNetworkInterface etc. before the VM can be created in Azure succesfully. - - - - New-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Location - - Location of the VM - - String - - - VM - - VM object that is configured and represents the state of the VM to be created. The VM object can be created using the New-AzureVMConfig cmdlet. The VM object must then be configured correctly using appropriate cmdlets such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Set-AzureVMNetworkInterface etc. before the VM can be created in Azure succesfully. - - PSVirtualMachine - - - Name - - - - String - - - Tags - - - - Hashtable[] - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Location - - Location of the VM - - String - - String - - - - - - VM - - VM object that is configured and represents the state of the VM to be created. The VM object can be created using the New-AzureVMConfig cmdlet. The VM object must then be configured correctly using appropriate cmdlets such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Set-AzureVMNetworkInterface etc. before the VM can be created in Azure succesfully. - - PSVirtualMachine - - PSVirtualMachine - - - - - - Name - - - - String - - String - - - - - - Tags - - - - Hashtable[] - - Hashtable[] - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Create a VM with two Data Disks -------------------------- - - PS C:\> - - PS C:\> # Common - $rgname = "myrg" - $loc = 'West US'; - $vmsize = 'Standard_A2'; - $vmname = 'vm' + $rgname; - - # Create Resource Group - New-AzureResourceGroup -Name $rgname -Location $loc; - - # Create VM Object - $vm = New-AzureVMConfig -VMName $vmname -VMSize $vmsize; - - # Setup Networking - $subnet = New-AzureVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24" -DnsServer "10.1.1.1"; - $vnet = New-AzureVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $subnet; - $vnet = Get-AzureVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname; - $subnetId = $vnet.Properties.Subnets[0].Id; - $pubip = New-AzurePublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -DomainNameLabel ('pubip' + $rgname); - $pubip = Get-AzurePublicIpAddress -Name ('pubip' + $rgname) -ResourceGroupName $rgname; - $pubipId = $pubip.Id; - $nic = New-AzureNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -SubnetId $subnetId -PublicIpAddressId $pubip.Id; - $nic = Get-AzureNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname; - $nicId = $nic.Id; - - # Add NIC to VM - $vm = Add-AzureVMNetworkInterface -VM $vm -Id $nicId; - - # Setup Storage - $stoname = 'sto' + $rgname; - $stotype = 'Standard_GRS'; - - New-AzureStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype; - $stoaccount = Get-AzureStorageAccount -ResourceGroupName $rgname -Name $stoname; - - $osDiskName = 'osDisk'; - $osDiskCaching = 'ReadWrite'; - $osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd"; - $dataDiskVhdUri1 = "https://$stoname.blob.core.windows.net/test/data1.vhd"; - $dataDiskVhdUri2 = "https://$stoname.blob.core.windows.net/test/data2.vhd"; - - # Add Data Disks - $vm = Add-AzureVMDataDisk -VM $vm -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $dataDiskVhdUri1; - $vm = Add-AzureVMDataDisk -VM $vm -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $dataDiskVhdUri2; - - # Setup OS & Image - $user = "Foo12"; - $password = 'BaR@123' + $rgname; - $securePassword = ConvertTo-SecureString $password -AsPlainText -Force; - $cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword); - - $computerName = 'test'; - $vhdContainer = "https://$stoname.blob.core.windows.net/test"; - $img = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201410.01-en.us-127GB.vhd'; - - $vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -Credential $cred; - $vm = Set-AzureVMSourceImage -VM $vm -Name $img -DestinationVhdsContainer $vhdContainer; - - # Create Virtual Machine - New-AzureVM -ResourceGroupName $rgname -Location $loc -Name $vmname -VM $vm; - - - - - - - - - - - - - - - - - - - - - - New-AzureVMConfig - - Create the configurable local VM Object - - - - - New - AzureVMConfig - - - - This cmdlet allows you to create the configurable local VM Object. The VM object must then be configured correctly using appropriate cmdlets such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Set-AzureVMNetworkInterface etc. before the VM can be created in Azure succesfully. - - - - New-AzureVMConfig - - VMName - - Name of the VM - - String - - - VMSize - - Size of the VM - - String - - - AvailabilitySetId - - Id of the Availability Set. This can be gotten through Get-AzureAvailabilitySet cmdlet. - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - VMSize - - Size of the VM - - String - - String - - - - - - AvailabilitySetId - - Id of the Availability Set. This can be gotten through Get-AzureAvailabilitySet cmdlet. - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Create a new VM Object -------------------------- - - PS C:\> - - # Get the Availability Set -$as = Get-AzureAvailabilitySet –ResourceGroupName “RG1” –Name “MyASet” - -# Create the VM object -$vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -AvailabilitySetID $as.Id - - - - - - - - - - - - - - - - - - - - - - Remove-AzureAvailabilitySet - - Remove an Availability Set from Azure - - - - - Remove - AzureAvailabilitySet - - - - Remove an Availability Set from Azure - - - - Remove-AzureAvailabilitySet - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the Availability Set - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the Availability Set - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Remove Availability Set -------------------------- - - PS C:\> - - PS C:\> Remove-AzureAvailabilitySet –Name “MyASet” –ResouceGroupName “RG1” - - - - - - - - - - - - - - - - - - - - - - Remove-AzureStorageAccount - - Remove Storage Account from Azure - - - - - Remove - AzureStorageAccount - - - - Remove Storage Account from Azure - - - - Remove-AzureStorageAccount - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Remove Storage Account -------------------------- - - PS C:\> - - PS C:\> Remove-AzureStorageAccount -ResourceGroupName "RG1" -AccountName "myStorageAccount" - - - - - - - - - - - - - - - - - - - - - - Remove-AzureVM - - Remove VM from Azure - - - - - Remove - AzureVM - - - - Remove VM from Azure - - - - Remove-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the VM - - String - - - Force - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Force - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Remove a VM -------------------------- - - PS C:\> - - PS C:\> Remove-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - - - - - - - - - - - - - - - - - - - - - Remove-AzureVMAccessExtension - - Remove the VMAccess extension from the VM - - - - - Remove - AzureVMAccessExtension - - - - Remove the VMAccess extension from the VM - - - - Remove-AzureVMAccessExtension - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of extension - - String - - - Force - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Resource Group of the VM - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of extension - - String - - String - - - - - - Force - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Remove-AzureVMCustomScriptExtension - - Remove the Custom Script extension from the VM - - - - - Remove - AzureVMCustomScriptExtension - - - - Remove the Custom Script extension from the VM - - - - Remove-AzureVMCustomScriptExtension - - ResourceGroupName - - Resource Group of the VM - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the extension to remove - - String - - - Force - - - - SwitchParameter - - - 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 to remove - - String - - String - - - - - - Force - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Remove-AzureVMDataDisk - - Remove a Data Disk from the VM - - - - - Remove - AzureVMDataDisk - - - - This cmdlet allows you to remove a Data Disk from the VM - - - - Remove-AzureVMDataDisk - - VM - - Local VM object to remove the Data Disk from. This object can be gotten from the Get-AzureVM cmdlet. - - PSVirtualMachine - - - Name - - Name of the Data Disk to be removed - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - Local VM object to remove the Data Disk from. This object can be gotten from the Get-AzureVM cmdlet. - - PSVirtualMachine - - PSVirtualMachine - - - - - - Name - - Name of the Data Disk to be removed - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Remove a Data Disk -------------------------- - - PS C:\> - - PS C:\> # Get the VM - $vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - # Remove "disk3" Data Disk from the local object - Remove-AzureVMDataDisk -VM $vm -Name 'disk3' - - # Update the state of the Azure VM - Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm - - - - - - - - - - - - - - - - - - - - - - Remove-AzureVMExtension - - Remove an Extension from a VM - - - - - Remove - AzureVMExtension - - - - Remove an extension from a VM - - - - Remove-AzureVMExtension - - ResourceGroupName - - Name of Resource Group - - String - - - VMName - - Name of the VM - - String - - - Name - - Name of the Extension - - String - - - Force - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of Resource Group - - String - - String - - - - - - VMName - - Name of the VM - - String - - String - - - - - - Name - - Name of the Extension - - String - - String - - - - - - Force - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Remove an Extension -------------------------- - - PS C:\> - - PS C:\> Remove-AzureVMExtension –ResouceGroupName "RG" –Name "myext" -VMName "vm1" - - - - - - - - - - - - - - - - - - ->>>>>>> 648c7babd1ebd26be6b156ee710c27906938c4fe + + + Add-AzureVMAdditionalUnattendContent @@ -8217,7 +37,7 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av SettingName - Specifies the name of the setting to which the content applies. Valid values are: + Specifies the name of the setting to which the content applies. Valid values are: -- FirstLogonCommands -- AutoLogon @@ -8261,7 +81,7 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av SettingName - Specifies the name of the setting to which the content applies. Valid values are: + Specifies the name of the setting to which the content applies. Valid values are: -- FirstLogonCommands -- AutoLogon @@ -8330,7 +150,7 @@ $vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" -Av PS C:\>$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +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>"; @@ -8441,10 +261,10 @@ The default value is ReadWrite. Changing this value causes the virtual machine t 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: + 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 +-- Attach +-- Empty -- FromImage @@ -8491,10 +311,10 @@ The default value is ReadWrite. Changing this value causes the virtual machine t 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: + 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 +-- Attach +-- Empty -- FromImage System.String @@ -8632,7 +452,7 @@ The default value is ReadWrite. Changing this value causes the virtual machine t - PS C:\>$VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" + 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" @@ -8695,7 +515,6 @@ PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMac -<<<<<<< HEAD Add-AzureVMNetworkInterface @@ -8836,7 +655,7 @@ PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMac - PS C:\>$VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" + 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" @@ -9065,13 +884,13 @@ PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name " VirtualMa - PS C:\>$VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id + 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 +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 @@ -9239,7 +1058,7 @@ PS C:\> $VirtualMachine = Add-AzureVMSecret -VM $VirtualMachine -SourceVaultI 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" +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. @@ -12893,7 +4712,7 @@ PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSiz - PS C:\># Variables + PS C:\># Variables ## Global $ResourceGroupName = "ResourceGroup11" $Location = "westeurope" @@ -13663,8 +5482,8 @@ New-AzureVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $Virtu - PS C:\>$VirtualMachine = Get-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -PS C:\> Remove-AzureVMDataDisk -VM $VirtualMachine -Name "disk3" + 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 @@ -14540,7 +6359,7 @@ PS C:\> Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMac - PS C:\>Set-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized + PS C:\>Set-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized PS C:\> Save-AzureVMImage -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -DestinationContainerName "VMContainer01" -VHDNamePrefix "VM07" @@ -15604,7 +7423,7 @@ PS C:\> $ProtectedSettings = @{"storageAccountName" = $stoname; "storageAccou 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 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. @@ -16013,8 +7832,8 @@ PS C:\> Set-AzureVMExtension -ResourceGroupName "ResourceGroup11" -Location " 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:\> $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" @@ -16095,7 +7914,7 @@ PS C:\> $VirtualMachine = Set-AzureVMOperatingSystem -VM $$VirtualMachine -Wi Caching - Specifies the caching mode of the operating system disk. Valid values are: + Specifies the caching mode of the operating system disk. Valid values are: -- ReadOnly -- ReadWrite @@ -16120,10 +7939,10 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma 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: + 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 +-- Attach +-- Empty -- FromImage This setting affects the consistency and performance of the disk. @@ -16175,7 +7994,7 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma Caching - Specifies the caching mode of the operating system disk. Valid values are: + Specifies the caching mode of the operating system disk. Valid values are: -- ReadOnly -- ReadWrite @@ -16200,10 +8019,10 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma 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: + 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 +-- Attach +-- Empty -- FromImage This setting affects the consistency and performance of the disk. @@ -16232,7 +8051,7 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma Caching - Specifies the caching mode of the operating system disk. Valid values are: + Specifies the caching mode of the operating system disk. Valid values are: -- ReadOnly -- ReadWrite @@ -16250,10 +8069,10 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma 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: + 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 +-- Attach +-- Empty -- FromImage This setting affects the consistency and performance of the disk. @@ -16396,8 +8215,8 @@ The default value is ReadWrite. Changing the caching value causes the virtual ma - PS C:\>$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id + 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 @@ -16646,7 +8465,7 @@ PS C:\> Set-AzureVMOSDisk -VM $VirtualMachine -Name "OsDisk02" -VhdUri "os.vh PS C:\>AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03" -PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id +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" @@ -16669,11 +8488,11 @@ PS C:\> Set-AzureVMSourceImage -VM $VirtualMachine -PublisherName "MicrosoftW - 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:\>$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:\> $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 @@ -17449,1870 +9268,4 @@ PS C:\> $VirtualMachine07 = Set-AzureVMSourceImage -VM $VirtualMachine07 -Ima -======= - - - Set-AzureVMOperatingSystem - - Set the OS properties for the VM - - - - - Set - AzureVMOperatingSystem - - - - This cmdlet allows you to set the OS properties such as login credentials, computer name etc. - - - - Set-AzureVMOperatingSystem - - VM - - The local VM object to set the OS properties on - - PSVirtualMachine - - - Windows - - Specify the type of OS is Windows - - SwitchParameter - - - ComputerName - - Name of the computer - - String - - - Credential - - PSCredential object that contains username and password for the VM - - PSCredential - - - CustomData - - Specifies a base-64 encoded string of custom data. The base-64 encoded string 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. - Linux - The file is copied to /var/lib/waagent/ovf-env.xml by the Azure Linux Agent. The agent will also place the base-64 encoded data in /var/lib/waagent/CustomData during provisioning. - Windows – The file is saved to %SYSTEMDRIVE%\AzureData\CustomData.bin. If the file exists, it is overwritten. The security on directory is set to System:Full Control and Administrators:Full Control. - - String - - - ProvisionVMAgent - - Indicates that the VM agent should be installed on the VM - - SwitchParameter - - - EnableAutoUpdate - - - - SwitchParameter - - - TimeZone - - - - String - - - WinRMHttp - - - - SwitchParameter - - - WinRMHttps - - - - SwitchParameter - - - WinRMCertificateUrl - - URL of certificate in KeyVault to be used for WinRM HTTPS - - Uri - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureVMOperatingSystem - - VM - - The local VM object to set the OS properties on - - PSVirtualMachine - - - Linux - - Specify the type of OS is Linux - - SwitchParameter - - - ComputerName - - Name of the computer - - String - - - Credential - - PSCredential object that contains username and password for the VM - - PSCredential - - - CustomData - - Specifies a base-64 encoded string of custom data. The base-64 encoded string 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. - Linux - The file is copied to /var/lib/waagent/ovf-env.xml by the Azure Linux Agent. The agent will also place the base-64 encoded data in /var/lib/waagent/CustomData during provisioning. - Windows – The file is saved to %SYSTEMDRIVE%\AzureData\CustomData.bin. If the file exists, it is overwritten. The security on directory is set to System:Full Control and Administrators:Full Control. - - String - - - DisablePasswordAuthentication - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - The local VM object to set the OS properties on - - PSVirtualMachine - - PSVirtualMachine - - - - - - Windows - - Specify the type of OS is Windows - - SwitchParameter - - SwitchParameter - - - - - - ComputerName - - Name of the computer - - String - - String - - - - - - Credential - - PSCredential object that contains username and password for the VM - - PSCredential - - PSCredential - - - - - - CustomData - - Specifies a base-64 encoded string of custom data. The base-64 encoded string 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. - Linux - The file is copied to /var/lib/waagent/ovf-env.xml by the Azure Linux Agent. The agent will also place the base-64 encoded data in /var/lib/waagent/CustomData during provisioning. - Windows – The file is saved to %SYSTEMDRIVE%\AzureData\CustomData.bin. If the file exists, it is overwritten. The security on directory is set to System:Full Control and Administrators:Full Control. - - String - - String - - - - - - ProvisionVMAgent - - Indicates that the VM agent should be installed on the VM - - SwitchParameter - - SwitchParameter - - - - - - EnableAutoUpdate - - - - SwitchParameter - - SwitchParameter - - - - - - TimeZone - - - - String - - String - - - - - - WinRMHttp - - - - SwitchParameter - - SwitchParameter - - - - - - WinRMHttps - - - - SwitchParameter - - SwitchParameter - - - - - - WinRMCertificateUrl - - URL of certificate in KeyVault to be used for WinRM HTTPS - - Uri - - Uri - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Linux - - Specify the type of OS is Linux - - SwitchParameter - - SwitchParameter - - - - - - DisablePasswordAuthentication - - - - SwitchParameter - - SwitchParameter - - - - - - Secrets - - Secrets config that specifies the source KeyVault and Certificate url. Use the Add-AzureVMSecret cmdlet to create this config. - - list`1[psvaultsecretgroup] - - list`1[psvaultsecretgroup] - - - - - - AdditionalUnattendContents - - AdditionalUnattendContent config. Use the Add-AzureVMAdditionalUnattendContent cmdlet to create this. - - list`1[psadditionalunattendcontent] - - list`1[psadditionalunattendcontent] - - - - - - SSHPublicKey - - SSH public key for the VM - - string[] - - string[] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $user = "Foo12"; -$password = 'BaR@123'; -$securePassword = ConvertTo-SecureString $password -AsPlainText -Force; -$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword); -$computerName = 'test2'; -$winRMCertUrl = "http://keyVaultName.vault.azure.net/secrets/secretName/secretVersion"; -$timeZone = "Pacific Standard Time"; -$custom = "echo 'Hello World'"; -$encodedCustom = "ZWNobyAnSGVsbG8gV29ybGQn"; - -# Create the VM Profile -$vm = New-AzureVMConfig –VMName “myVM” -AvailabilitySetID $as1.Id –VMSize “Standard_A1" - -# Set OS properties -$vm = Set-AzureVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -Credential $cred -CustomData $custom -WinRMHttp -WinRMHttps -WinRMCertificateUrl $winRMCertUrl -ProvisionVMAgent -EnableAutoUpdate -TimeZone $timeZone; - - - - - - - - - - - - - - - - - - - - - - Set-AzureVMOSDisk - - Set the OS Disk properties on the VM - - - - - Set - AzureVMOSDisk - - - - Set the OS Disk properties on the VM - - - - Set-AzureVMOSDisk - - VM - - The local VM object to set the OS Disk properties on - - PSVirtualMachine - - - Name - - Name of the OS Disk - - String - - - VhdUri - - 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. - - String - - - Caching - - Specifies the caching mode of the operating system disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. - Possible values are: The default value is ReadWrite. - • ReadOnly - • ReadWrite - - String - - - SourceImageUri - - Uri of the existing VHD in case attaching the disk to the VM - - String - - - CreateOption - - Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are - "FromImage”, “Attach” or “Empty” - - String - - - Windows - - Used in case of a user image based VM deployment to specify that the OS on the user image is Windows. - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureVMOSDisk - - VM - - The local VM object to set the OS Disk properties on - - PSVirtualMachine - - - Name - - Name of the OS Disk - - String - - - VhdUri - - 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. - - String - - - Caching - - Specifies the caching mode of the operating system disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. - Possible values are: The default value is ReadWrite. - • ReadOnly - • ReadWrite - - String - - - SourceImageUri - - Uri of the existing VHD in case attaching the disk to the VM - - String - - - CreateOption - - Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are - "FromImage”, “Attach” or “Empty” - - String - - - Linux - - Used in case of a user image based VM deployment to specify that the OS on the user image is Linux. - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - The local VM object to set the OS Disk properties on - - PSVirtualMachine - - PSVirtualMachine - - - - - - Name - - Name of the OS Disk - - String - - String - - - - - - VhdUri - - 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. - - String - - String - - - - - - Caching - - Specifies the caching mode of the operating system disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. - Possible values are: The default value is ReadWrite. - • ReadOnly - • ReadWrite - - String - - String - - - - - - SourceImageUri - - Uri of the existing VHD in case attaching the disk to the VM - - String - - String - - - - - - CreateOption - - Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are - "FromImage”, “Attach” or “Empty” - - String - - String - - - - - - Windows - - Used in case of a user image based VM deployment to specify that the OS on the user image is Windows. - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Linux - - Used in case of a user image based VM deployment to specify that the OS on the user image is Linux. - - SwitchParameter - - SwitchParameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - $stoname = 'teststo'; - -$osDiskName = 'osDisk'; -$osDiskCaching = 'ReadWrite'; -$osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd"; - -$vm = Set-AzureVMOSDisk -VM $vm -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption Empty; - - - - - - - - - - - - - - - - - - - - - - Set-AzureVMSourceImage - - Specify the VM Image to be used for the VM - - - - - Set - AzureVMSourceImage - - - - Specify the VM Image to be used for the VM - - - - Set-AzureVMSourceImage - - VM - - The local VM object to be configured - - PSVirtualMachine - - - PublisherName - - Name of the Publisher to be used for the VMImage. Can be discovered using the Get-AzureVMImagePublisher cmdlet - - String - - - Offer - - Name of the Offer to be used for the VMImage. Can be discovered using the Get-AzureVMImageOffer cmdlet - - String - - - Skus - - Name of the SKU to be used for the VMImage. Can be discovered using the Get-AzureVMImageSku cmdlet - - String - - - Version - - Name of the Version to be used for the VMImage. Can be discovered using the Get-AzureVMImage cmdlet - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - Set-AzureVMSourceImage - - VM - - The local VM object to be configured - - PSVirtualMachine - - - Name - - Name of the Source Image - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - VM - - The local VM object to be configured - - PSVirtualMachine - - PSVirtualMachine - - - - - - PublisherName - - Name of the Publisher to be used for the VMImage. Can be discovered using the Get-AzureVMImagePublisher cmdlet - - String - - String - - - - - - Offer - - Name of the Offer to be used for the VMImage. Can be discovered using the Get-AzureVMImageOffer cmdlet - - String - - String - - - - - - Skus - - Name of the SKU to be used for the VMImage. Can be discovered using the Get-AzureVMImageSku cmdlet - - String - - String - - - - - - Version - - Name of the Version to be used for the VMImage. Can be discovered using the Get-AzureVMImage cmdlet - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - Name - - Name of the Source Image - - String - - String - - - - - - ImageReference - - Image reference to use for the VM. This is an object that can be passed in from the return of the Get-AzureVMImage or the Get-AzureVMImageDetail cmdlet - - psvirtualmachineimage - - psvirtualmachineimage - - - - - - DestinationVhdsContainer - - Container to be used for storing VHDs while creating a VM from platform image. Container will be created by CRP if it doesn’t exist already. - - string - - string - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - # Create the VM object -$vm = New-AzureVMConfig –VMName “myVM” –VMSize “Standard_A1" - -# Set the PublisherName, Offer, SKU, Version which can be discovered by the Get-AzureVMImagePublisher, Get-AzureVMImageOffer, Get-AzureVMSku, Get-AzureVMImage cmdlets -Set-AzureVMSourceImage -VM $vm -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest" - - - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - $loc = "eastasia"; -$query = '*Microsoft*Windows*Server'; - -$publisher = (Get-AzureVMImagePublisher -Location $loc) | select -ExpandProperty PublisherName | where { $_ -like $query }; -$offer = (Get-AzureVMImageOffer -Location $loc -PublisherName $publisher[0]) | select -ExpandProperty Offer | where { $_ -like '*Windows*' }; -$sku = (Get-AzureVMImageSku -Location $loc -PublisherName $publisher[0] -Offer $offer[0]) | select -ExpandProperty Skus; -$versions = (Get-AzureVMImage -Location $loc -Offer -Offer $offer[0] -PublisherName $publisher[0] -Skus $sku[0]) | select -ExpandProperty Version; -$vmimg = Get-AzureVMImageDetail -Location $loc -Offer -Offer $offer[0] -PublisherName $publisher[0] -Skus $sku[0] -Version $versions[0]; - -$vm = Set-AzureVMSourceImage -VM $vm -ImageReference $vmimg; - - Set source image using the image reference method - - - - - - - - - - - - - - -------------------------- Example 3 -------------------------- - - PS C:\> - - $vhdContainer = "https://$stoname.blob.core.windows.net/test"; - -Switch-AzureMode AzureServiceManagement -Get-AzureVMImage -$img = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201410.01-en.us-127GB.vhd'; -Switch-AzureMode AzureResourceManager - -Set-AzureVMSourceImage -VM $vm -Name $img -DestinationVhdsContainer $vhdContainer; - - - - - - - - - - - - - - - - - - - - - - Start-AzureVM - - Start a VM - - - - - Start - AzureVM - - - - This cmdlet allows you to start a VM - - - - Start-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the VM - - String - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Start-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - - - - - - - - - - - - - - - - - - - - - Stop-AzureVM - - Stop a VM - - - - - Stop - AzureVM - - - - This cmdlet allows you to Stop a VM - - - - Stop-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - Name - - Name of the VM - - String - - - Force - - - - SwitchParameter - - - StayProvisioned - - - - SwitchParameter - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - Name - - Name of the VM - - String - - String - - - - - - Force - - - - SwitchParameter - - SwitchParameter - - - - - - StayProvisioned - - - - SwitchParameter - - SwitchParameter - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Stop-AzureVM -ResourceGroupName "myRG" -Name "crpVM" - - - - - - - - - - - - - - - - - - - - - - Update-AzureVM - - Update the Azure VM state - - - - - Update - AzureVM - - - - This cmdlet allows you to update the Azure VM state with the state of the local VM object - - - - Update-AzureVM - - ResourceGroupName - - Name of the Resource Group - - String - - - VM - - The local VM object that contains the updating VM state - - PSVirtualMachine - - - Name - - Name of the VM - - String - - - Tags - - - - Hashtable[] - - - Profile - - - - AzureProfile - - - InformationAction - - - - ActionPreference - - - InformationVariable - - - - String - - - - - - ResourceGroupName - - Name of the Resource Group - - String - - String - - - - - - VM - - The local VM object that contains the updating VM state - - PSVirtualMachine - - PSVirtualMachine - - - - - - Name - - Name of the VM - - String - - String - - - - - - Tags - - - - Hashtable[] - - Hashtable[] - - - - - - Profile - - - - AzureProfile - - AzureProfile - - - - - - InformationAction - - - - ActionPreference - - ActionPreference - - - - - - InformationVariable - - - - String - - String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm - - - - - - - - - - - - - - - - - - ->>>>>>> 648c7babd1ebd26be6b156ee710c27906938c4fe