i have this powershell that i am looking to tweak so it only gives me lines with a snapshot and timestamp. At the moment its giving me all virtual machines, with or without a snapshot. I just want to filter it so i get VMs with a snapshot only and associated timestamp, i guess which ever will work to filter for VMs with a snapshot
Get-VM | Format-Table -AutoSize VMName, @{Name="TotalSnapshots";Expression={(Get-VMSnapshot -VM $_ | Measure-Object).Count}},@{Name="TimeStamp";Expression={(Get-VMSnapshot -VM $_ | Select-Object CreationTime).CreationTime}}