With the command variables set, you can then retrieve the configuration of the myVM3 virtual machine and store it in a variable, called $vm. Once the existing configuration of myVM3 is stored in the variable, it will be used to create the snapshot.
Run the following Get-AzureRmVm command to retrieve the myVM3 virtual machine configuration and store it in the variable:
$vm = Get-AzureRmVm `
-ResourceGroupName $resourceGroupName `
-Name $vmName
This command takes a few moments to run sometimes.