How Do You Use a PowerShell Command to Destroy an Azure VM?

Problem scenario
You have a server in Azure you no longer need. You want to save money by deleting it. What should you do to eliminate it?

You need to know the server's name and resource group. You can do this by finding the server in the Azure Portal.

Run this command:

Remove-AzureRmVM -ResourceGroupName $nameOfResourceGroup -Name $nameOfVM

# Replace $nameOfResourceGroup with the name of the Resource Group.  Replace $nameOfVM with the name of the the VM.

Leave a comment

Your email address will not be published. Required fields are marked *