Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 201745

Re: snapshot script help

$
0
0


I have take a bit more of a look at this, so ignore my previous post.  The best way to acheive what you need is to remove the line:

 

$Daysold = Get-VM  $GuestName | Get-Snapshot | Select @{N="DaysOld"; e={((Get-Date) - $_.Created).Days}} 

 

Then because we are already retireving the created date for each snapshot to get the count of days since it was created as a propertie of the object all you need to to is change the line creating that property to:

 

  $objReport | Add-Member -Type NoteProperty -Name "Days Old" -Value $((Get-Date) - $Snapshot.Created).Day

 

This should then create this property uniquely for each snapshot reported avaoiding the problem you are getting.

 

FYI, I am not near an environment I can test this on, so the syntax may be slightly off, but should point you in the right direction.


Viewing all articles
Browse latest Browse all 201745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>