PowerShell Logo Small

Get-VM



This is the built-in help made by Microsoft for the command 'Get-VM', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Gets the virtual machines from one or more Hyper-V hosts.

SYNTAX


Get-VM [[-Name] <String[]>] [-ComputerName <String[]>] [<CommonParameters>]
Get-VM [-ClusterObject] <PSObject> [<CommonParameters>]
Get-VM [[-Id] <Guid>] [-ComputerName <String[]>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-VM cmdlet gets the virtual machines from one or more Hyper-V hosts.



<

RELATED LINKS






REMARKS

<

Examples


Example 1

PS C:\>Get-VM



This example gets all virtual machines on the local virtual machine host.




Example 2

PS C:\>Get-VM –ComputerName Server1 | Where-Object {$_.State –eq ‘Running’}



This example gets all virtual machines on Hyper-V host Server1 that are running.




Example 3

PS C:\>Get-ClusterGroup | ? {$_.GroupType –eq ‘VirtualMachine’ } | Get-VM



This example gets all virtual machines in the cluster to which the local Hyper-V host is joined.