Get all vm’s on a hyper-v server and output to text file

2013/01/28 | By | Reply More

This two line PowerShell script will get all vm’s on a hyper-v server and output to text file. Change path and name of vmrunning.txt to suit your needs.

Works on Server 2012 with powershell 3

[sourcecode language=”powershell” padlinenumbers=”true”]
Get-VM | Where-Object {$_.State -eq ‘Running’} | out-file -filepath C:VMrunning.txt
C:VMrunning.txt
[/sourcecode]

Tags:

Category: Uncategorized

Leave a Reply

You must be logged in to post a comment.