Skip to content

Instantly share code, notes, and snippets.

Avatar

Admin0fThings

View GitHub Profile
View gist:40dd710435020d25e4edf7bb393cec63
# Get all clusters
$clusters = Get-Cluster
# Loop through each cluster
$result = foreach ($cluster in $clusters) {
     # Use calculated properties to create custom object
     Get-VM -Location $cluster | Select @{n='Cluster';e={$cluster}},@{n='VM Name';e={$_.Name}}
}
You can’t perform that action at this time.