@@ -60,7 +60,7 @@ $net = @{
6060 AddressPrefix = '10.0.0.0/16','2404:f800:8000:122::/63'
6161 Subnet = $subnetConfig
6262}
63- $vnet = New-AzVirtualNetwork @net
63+ New-AzVirtualNetwork @net
6464
6565```
6666
@@ -78,9 +78,9 @@ $ip4 = @{
7878 Sku = 'Standard'
7979 AllocationMethod = 'Static'
8080 IpAddressVersion = 'IPv4'
81- Zone = '1 2 3'
81+ Zone = 1,2,3
8282}
83- $publicIP-IPv4 = New-AzPublicIpAddress @ip4
83+ New-AzPublicIpAddress @ip4
8484
8585$ip6 = @{
8686 Name = 'myPublicIP-IPv6'
@@ -89,9 +89,9 @@ $ip6 = @{
8989 Sku = 'Standard'
9090 AllocationMethod = 'Static'
9191 IpAddressVersion = 'IPv6'
92- Zone = '1 2 3'
92+ Zone = 1,2,3
9393}
94- $publicIP-IPv6 = New-AzPublicIpAddress @ip6
94+ New-AzPublicIpAddress @ip6
9595```
9696## Create a network security group
9797
@@ -202,7 +202,7 @@ $nic = @{
202202 NetworkSecurityGroup = $nsg
203203 IpConfiguration = $IPv4Config,$IPv6Config
204204}
205- $nicVM = New-AzNetworkInterface @nic
205+ New-AzNetworkInterface @nic
206206```
207207
208208### Create virtual machine
@@ -220,7 +220,6 @@ Use the following commands to create the virtual machine:
220220* [ Add-AzVMNetworkInterface] ( /powershell/module/az.compute/add-azvmnetworkinterface )
221221
222222``` azurepowershell-interactive
223- # Set the administrator and password for the VM. ##
224223$cred = Get-Credential
225224
226225## Place network interface into a variable. ##
@@ -232,17 +231,17 @@ $nicVM = Get-AzNetworkInterface @nic
232231
233232## Create a virtual machine configuration for VMs ##
234233$vmsz = @{
235- VMName = " myVM"
234+ VMName = ' myVM'
236235 VMSize = 'Standard_DS1_v2'
237236}
238237$vmos = @{
239- ComputerName = " myVM"
238+ ComputerName = ' myVM'
240239 Credential = $cred
241240}
242241$vmimage = @{
243- PublisherName = 'Canonical '
244- Offer = 'UbuntuServer '
245- Skus = '18.04-LTS '
242+ PublisherName = 'Debian '
243+ Offer = 'debian-11 '
244+ Skus = '11 '
246245 Version = 'latest'
247246}
248247$vmConfig = New-AzVMConfig @vmsz `
@@ -273,7 +272,11 @@ Get-AzPublicIPAddress @ip4 | select IpAddress
273272```
274273
275274``` azurepowershell-interactive
275+ PS /home/user> Get-AzPublicIPAddress @ip4 | select IpAddress
276276
277+ IpAddress
278+ ---------
279+ 20.72.115.187
277280```
278281
279282``` azurepowershell-interactive
@@ -285,13 +288,17 @@ Get-AzPublicIPAddress @ip6 | select IpAddress
285288```
286289
287290``` azurepowershell-interactive
291+ PS /home/user> Get-AzPublicIPAddress @ip6 | select IpAddress
288292
293+ IpAddress
294+ ---------
295+ 2603:1030:403:3::1ca
289296```
290297
291298Open an SSH connection to the virtual machine by using the following command. Replace the IP address with the IP address of your virtual machine.
292299
293300``` azurepowershell-interactive
294- ssh azureuser@20.119.201.208
301+ ssh azureuser@20.72.115.187
295302```
296303
297304## Clean up resources
0 commit comments