You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **New-AzureRmVM** cmdlet creates a virtual machine in Azure.
23
33
This cmdlet takes a virtual machine object as input.
24
34
Use the New-AzureRmVMConfig cmdlet to create a virtual machine object.
25
35
Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk.
26
36
37
+
The `StrategyParameterSet` provides a convenient method to create a VM by making common VM creation arguments optional.
This example script shows how to create a virtual machine.
@@ -138,6 +104,52 @@ You can confirm your login status by using the **Get-AzureSubscription** cmdlet.
138
104
139
105
## PARAMETERS
140
106
107
+
### -AddressPrefix
108
+
The address prefix for the virtual network which will be created for the VM.
109
+
110
+
```yaml
111
+
Type: String
112
+
Parameter Sets: StrategyParameterSet
113
+
Aliases:
114
+
115
+
Required: False
116
+
Position: Named
117
+
Default value: 192.168.0.0/16
118
+
Accept pipeline input: False
119
+
Accept wildcard characters: False
120
+
```
121
+
122
+
### -AllocationMethod
123
+
The IP allocation method for the public IP which will be created for the VM.
124
+
125
+
```yaml
126
+
Type: String
127
+
Parameter Sets: StrategyParameterSet
128
+
Aliases:
129
+
Accepted values: Static, Dynamic
130
+
131
+
Required: False
132
+
Position: Named
133
+
Default value: Static
134
+
Accept pipeline input: False
135
+
Accept wildcard characters: False
136
+
```
137
+
138
+
### -Credential
139
+
The administrator credentials for the VM.
140
+
141
+
```yaml
142
+
Type: PSCredential
143
+
Parameter Sets: StrategyParameterSet
144
+
Aliases:
145
+
146
+
Required: True
147
+
Position: Named
148
+
Default value: None
149
+
Accept pipeline input: False
150
+
Accept wildcard characters: False
151
+
```
152
+
141
153
### -DefaultProfile
142
154
The credentials, account, tenant, and subscription used for communication with azure.
143
155
@@ -158,7 +170,22 @@ Indicates that this cmdlet does not install the **BG Info** extension on the vir
158
170
159
171
```yaml
160
172
Type: SwitchParameter
161
-
Parameter Sets: (All)
173
+
Parameter Sets: DefaultParameterSet
174
+
Aliases:
175
+
176
+
Required: False
177
+
Position: 3
178
+
Default value: None
179
+
Accept pipeline input: False
180
+
Accept wildcard characters: False
181
+
```
182
+
183
+
### -DomainNameLabel
184
+
The subdomain label for the fully-qualified domain name (FQDN) of the VM. This will take the form `{domainNameLabel}.{location}.cloudapp.azure.com`.
185
+
186
+
```yaml
187
+
Type: String
188
+
Parameter Sets: StrategyParameterSet
162
189
Aliases:
163
190
164
191
Required: False
@@ -168,6 +195,21 @@ Accept pipeline input: False
168
195
Accept wildcard characters: False
169
196
```
170
197
198
+
### -ImageName
199
+
The friendly image name upon which the VM will be built. These include: Win2016Datacenter, Win2012R2Datacenter, Win2012Datacenter, Win2008R2SP1, UbuntuLTS, CentOS, CoreOS, Debian, openSUSE-Leap, RHEL, SLES.
200
+
201
+
```yaml
202
+
Type: String
203
+
Parameter Sets: StrategyParameterSet
204
+
Aliases:
205
+
206
+
Required: False
207
+
Position: Named
208
+
Default value: Win2016Datacenter
209
+
Accept pipeline input: False
210
+
Accept wildcard characters: False
211
+
```
212
+
171
213
### -LicenseType
172
214
Specifies a license type, which indicates that the image or disk for the virtual machine was licensed on-premises.
173
215
This value is used only for images that contain the Windows Server operating system.
@@ -181,7 +223,7 @@ If you specify this parameter for an update, the value must match the initial va
181
223
182
224
```yaml
183
225
Type: String
184
-
Parameter Sets: (All)
226
+
Parameter Sets: DefaultParameterSet
185
227
Aliases:
186
228
187
229
Required: False
@@ -196,7 +238,7 @@ Specifies a location for the virtual machine.
A list of ports to open on the network security group (NSG) for the created VM. The default value depends on the type of image chosen (i.e., Windows: 3389, 5985 and Linux: 22).
280
+
281
+
```yaml
282
+
Type: Int32[]
283
+
Parameter Sets: StrategyParameterSet
284
+
Aliases:
285
+
286
+
Required: False
287
+
Position: Named
288
+
Default value: None
289
+
Accept pipeline input: False
290
+
Accept wildcard characters: False
291
+
```
292
+
293
+
### -PublicIpAddressName
294
+
The name of a new (or existing) public IP address for the created VM to use. If not specified, a name will be generated.
The name of a new (or existing) virtual network for the created VM to use. If not specified, a name will be generated.
399
+
400
+
```yaml
401
+
Type: String
402
+
Parameter Sets: StrategyParameterSet
403
+
Aliases:
404
+
405
+
Required: False
406
+
Position: Named
407
+
Default value: None
408
+
Accept pipeline input: False
409
+
Accept wildcard characters: False
410
+
```
411
+
241
412
### -VM
242
413
Specifies a local virtual machine to create.
243
414
To obtain a virtual machine object, use the New-AzureRmVMConfig cmdlet.
244
415
Other cmdlets can be used to configure the virtual machine, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, and Add-AzureRmVMNetworkInterface.
245
416
246
417
```yaml
247
418
Type: PSVirtualMachine
248
-
Parameter Sets: (All)
419
+
Parameter Sets: DefaultParameterSet
249
420
Aliases: VMProfile
250
421
251
422
Required: True
@@ -260,7 +431,7 @@ Specifies the zone list of the virtual machine.
0 commit comments