Tag: Powershell

Get memory configuration of all vm’s on hyper-v server and output to text file

Two line powershell script that gets memory configuration of all vm’s and outputs to text file.  Change path and name of vmmemory.txt to suit your needs.

Works on Server 2012 with powershell 3

[sourcecode language=”powershell” padlinenumbers=”true”]
Get-VM | Get-VMMemory | out-file -filepath C:\VMMemory.txt
C:\VMMemory.txt

[/sourcecode]

2013/01/28 | By | Reply More

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

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]

2013/01/28 | By | Reply More