PowerShell Logo Small

Remove-VM



This is the built-in help made by Microsoft for the command 'Remove-VM', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Deletes a virtual machine.

SYNTAX


Remove-VM [-Name] <String[]> [-AsJob] [-ComputerName <String[]>] [-Force] [-Passthru] [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-VM [-VM] <VirtualMachine[]> [-AsJob] [-Force] [-Passthru] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-VM cmdlet deletes a virtual machine. Running this cmdlet deletes the virtual machine’s configuration file, but does not delete any virtual hard drives. If the
virtual machine has any snapshots, these are deleted and merged into the virtual hard disk files after the virtual machine is deleted.



<

RELATED LINKS


Online Version: http://go.microsoft.com/fwlink/?LinkID=306902

REMARKS

<

Examples


Example 1

PS C:\>Remove-VM "new 1"
Confirm: Are you sure you want to remove virtual machine "new 1"?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y



Removes virtual machine new 1.




Example 2

PS C:\>Remove-VM –Name "new 2" -Force



Removes virtual machine new 2, suppressing the confirmation prompt.




Example 3

PS C:\>Get-VM –Name New* | Remove-VM -Force



Removes with no confirmation prompt all virtual machines having names starting with New.