Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
snapshotfind.ps1
$Days = $%id%Days%id%
$Days = (get-date).adddays(-($Days))
$SnapshotList = $null
$SnapshotList = Get-VM | Get-VMSnapshot | where-object { $_.CreationTime -lt $Days }
if ($SnapshotList -eq $null)
{
$OverdueSnapshot = "NO Overdue Snapshot"
}
else
{
foreach ($EachSS in $SnapshotList)
{
$OverdueSnapshot += "$EachSS.VMName : $EachSS.Name : $EachSS.CreationTime : "
}
}
$%id%OverdueSnapshot%id% = $OverdueSnapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.