Skip to content

Instantly share code, notes, and snippets.

@Dapacruz
Last active November 19, 2018 18:45
Show Gist options
  • Save Dapacruz/98540fd8c10af5ee115ef2e23626fe6e to your computer and use it in GitHub Desktop.
Save Dapacruz/98540fd8c10af5ee115ef2e23626fe6e to your computer and use it in GitHub Desktop.
Get a VM snapshot report and output to clipboard, CSV or console.
## CSV format out to clipboard
Get-Snapshot -VM * | select VM,Name,Created,PowerState,Description,@{n='SizeGB';e={'{0:N2}' -f $_.sizegb}} | sort SizeGB | ConvertTo-Csv -NoTypeInformation -Delimiter `t | clip
## Out to CSV
Get-Snapshot -VM * | select VM,Name,Created,PowerState,Description,@{n='SizeGB';e={'{0:N2}' -f $_.sizegb}} | sort SizeGB | Export-Csv -NoTypeInformation -Path 'VMware Virtual Machine Snapshots.csv'
## Out to console
Get-Snapshot -VM * | select VM,Name,Created,PowerState,Description,@{n='SizeGB';e={'{0:N2}' -f $_.sizegb}} | sort SizeGB | ft -auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment