PowerCLI

 View Only
  • 1.  list all snapshots

    Posted Mar 02, 2022 01:29 PM

    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?



  • 2.  RE: list all snapshots

    Posted Mar 02, 2022 01:51 PM

    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}}


  • 3.  RE: list all snapshots

    Posted Mar 02, 2022 02:06 PM

    wow, I would have never thought of that.

    Thank you!