Created
April 27, 2011 10:56
-
-
Save jbarber/944059 to your computer and use it in GitHub Desktop.
Enumerate VMware guests and the datastores each one uses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vms = get-view -type virtualmachine | |
$hosts = $vms | %{ | |
$obj = New-Object Object | |
$obj | Add-Member noteproperty name $_.name | |
$obj | Add-Member noteproperty datastores ($_.datastore | %{(get-view -Id $_).Name}) | |
$obj | |
} | |
# Dump to CSV | |
$hosts | convertto-csv > hosts.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment