Automation

 View Only
  • 1.  List snapshots by size and age

    Posted Jun 20, 2012 08:51 PM

    Can anyone advise on a powershell script which lists all snapshots on the VM's in virtual centre.  Also the size of the snapshot in GB.

    So it would look like:

    VM Name,  Snapshot Name, Size in G, age

    Is the age column possible on how old the snapshot is.



  • 2.  RE: List snapshots by size and age

    Posted Jun 20, 2012 09:32 PM

    Try something like this

    Get-VM | Get-Snapshot | 
    Select @{N="VMName";E={$_.VM.Name}},Name,
    @{N="Size GB";E={[int]($_.SizeMb/1KB)}},
    @{N="Age";E={[int](New-TimeSpan -Start $_.Created -End (Get-Date)).TotalDays}}


  • 3.  RE: List snapshots by size and age

    Posted Jun 21, 2012 05:39 AM

    download vcheck v6..I think it does snapshot name and age...could be changed to add in size I suppose...

    I find age is the primary look for me since nothing should be over a few days anyhow