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

Re: snapshot script help

$
0
0

Hi Monderick

 

I think I can see where the problem is, where the line   $Daysold = Get-VM  $GuestName | Get-Snapshot | Select @{N="DaysOld"; e={((Get-Date) - $_.Created).Days}}   has been added if the VM has multiple snapshots then $Daysold will be an array, which when it is then being added to the object the array is not being enumerated causing the error you are getting.

 

I am not in a position to be able to test this at the moment but if where you are adding the days old propertie to the object you use just $DaysOld instead of $daysOld.DaysOld it should work,  If not I can take a bit more of a look at this later on.


Viewing all articles
Browse latest Browse all 201745

Trending Articles



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