HrcoCro
Contributor
Contributor

list all snapshots

I have a script that can list all the snapshots on vcenter

get-vm | get-snapshot | Select-Object -Property vm,created,sizeGB,name,description | Export-Csv -Path 'C:\Scripts\snapshot\snapshots.csv' -NoTypeInformation -Delimiter ";"

 

is it possible to add cluster information into it?

0 Kudos
2 Replies
LucD
Leadership
Leadership

Sure, try like this

Get-Cluster -PipelineVariable cluster |
Get-VM | Get-Snapshot | 
select @{N='VM';E={$_.VM.Name}}, Name, Description, Created, SizeGB,
    @{N='Cluster';E={$cluster.Name}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

HrcoCro
Contributor
Contributor

wow, I would have never thought of that.

Thank you!

0 Kudos