Powershell to Find Snapshot File

$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
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Tags: Find, powershell, snapshot, Vmware

Trackback from your site.