Skip to content

Commit dcace32

Browse files
author
Maddie Clayton
authored
Merge pull request #5870 from sergey-shandar/sergey-vm-docs
Docs: New-AzureRmVm example update
2 parents 7efa9f3 + 28d3ac8 commit dcace32

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

src/ResourceManager/Compute/Commands.Compute/help/New-AzureRmVM.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,40 @@ The `SimpleParameterSet` provides a convenient method to create a VM by making c
5252

5353
### Example 1: Create a virtual machine
5454
```
55-
PS C:\> New-AzureRmVM -Name MyVm
55+
PS C:\> New-AzureRmVM -Name MyVm -Credential (Get-Credential)
56+
57+
VERBOSE: Use 'mstsc /v:myvm-222222.eastus.cloudapp.azure.com' to connect to the VM.
58+
59+
ResourceGroupName : MyVm
60+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyVm/provi
61+
ders/Microsoft.Compute/virtualMachines/MyVm
62+
VmId : 11111111-1111-1111-1111-111111111111
63+
Name : MyVm
64+
Type : Microsoft.Compute/virtualMachines
65+
Location : eastus
66+
Tags : {}
67+
HardwareProfile : {VmSize}
68+
NetworkProfile : {NetworkInterfaces}
69+
OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets}
70+
ProvisioningState : Succeeded
71+
StorageProfile : {ImageReference, OsDisk, DataDisks}
72+
FullyQualifiedDomainName : myvm-222222.eastus.cloudapp.azure.com
5673
```
5774

5875
This example script shows how to create a virtual machine.
76+
The script will ask a user name and password for the VM.
5977
This script uses several other cmdlets.
6078

6179
### Example 2: Create a virtual machine from a custom user image
6280
```
6381
PS C:\> ## VM Account
6482
# Credentials for Local Admin account you created in the sysprepped (generalized) vhd image
6583
$VMLocalAdminUser = "LocalAdminUser"
66-
$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force
84+
$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force
6785
## Azure Account
6886
$LocationName = "westus"
6987
$ResourceGroupName = "MyResourceGroup"
70-
# This a Premium_LRS storage account.
88+
# This a Premium_LRS storage account.
7189
# It is required in order to run a client VM with efficiency and high performance.
7290
$StorageAccount = "Mydisk"
7391
@@ -77,9 +95,9 @@ $ComputerName = "MyClientVM"
7795
$OSDiskUri = "https://Mydisk.blob.core.windows.net/disks/MyOSDisk.vhd"
7896
$SourceImageUri = "https://Mydisk.blob.core.windows.net/vhds/MyOSImage.vhd"
7997
$VMName = "MyVM"
80-
# Modern hardware environment with fast disk, high IOPs performance.
98+
# Modern hardware environment with fast disk, high IOPs performance.
8199
# Required to run a client VM with efficiency and performance
82-
$VMSize = "Standard_DS3"
100+
$VMSize = "Standard_DS3"
83101
$OSDiskCaching = "ReadWrite"
84102
$OSCreateOption = "FromImage"
85103
@@ -97,7 +115,7 @@ $Vnet = New-AzureRmVirtualNetwork -Name $NetworkName -ResourceGroupName $Resourc
97115
$PIP = New-AzureRmPublicIpAddress -Name $PublicIPAddressName -DomainNameLabel $DNSNameLabel -ResourceGroupName $ResourceGroupName -Location $LocationName -AllocationMethod Dynamic
98116
$NIC = New-AzureRmNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroupName -Location $LocationName -SubnetId $Vnet.Subnets[0].Id -PublicIpAddressId $PIP.Id
99117
100-
$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
118+
$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
101119
102120
$VirtualMachine = New-AzureRmVMConfig -VMName $VMName -VMSize $VMSize
103121
$VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate
@@ -287,7 +305,7 @@ Specifies a license type, which indicates that the image or disk for the virtual
287305
This value is used only for images that contain the Windows Server operating system.
288306
The acceptable values for this parameter are:
289307

290-
- Windows_Client
308+
- Windows_Client
291309
- Windows_Server
292310

293311
This value cannot be updated.

0 commit comments

Comments
 (0)