Retrieving Vnet and subnet information

With the virtual machine retrieved and stored in the $vm variable, it's now time to run two commands that will retrieve information relating to the virtual network and subnet. As you can see in the following commands, we are going to attach the new NIC to the mySubnet subnet on the myVnet virtual network:

$myVnet = Get-AzureRmVirtualNetwork `
-Name "myVnet" `
-ResourceGroupName "VMLab"
$subnet = $myVnet.Subnets|?{$_.Name -eq 'mySubnet'}

The preceding commands store the virtual network and subnet information in variables so that they can be modified when the NIC is attached.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.198.173