Skip to content

Instantly share code, notes, and snippets.

View Admin0fThings's full-sized avatar

Admin0fThings

View GitHub Profile
# 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}}
}