VI Toolkit powershell simple script #4: VM Information

This is a good powershell script for tacking virtual machine inforamtion for change management. It will output the vm''s name, the host it is on, the power

From the archive. Originally published on dailyhypervisor.com on April 1, 2009.

This is a good powershell script for tacking virtual machine inforamtion for change management. It will output the vm''s name, the host it is on, the powerstate, Memory, Number of CPU''s, IP address, and FQDN to a csv file.

$IPprop = @{ Name = "IP Address"; Expression = { $_.Guest.IpAddress } } $HostNameProp = @{ Name = "Hostname"; Expression = { $_.Guest.Hostname } } Get-VM | select name, host, powerstate, MemoryMB, numCPU, $IPprop, $HostNameProp | export-csv c:vm_info.csv