I am new with Power cli.. created below script to delete VM snapshot for particular VMs mentioned in a CSV file.
$date = get-date -format "yyyyMMdd_HHmmss"
Import-Csv C:\Output\PatchingVMsList.csv | %{Get-VM $_.Name} | Get-Snapshot -Name BeforePatching | Remove-Snapshot -Confirm:$false -RunAsync
| Export-CSV C:\output\SnapshotRemoval-$date.csv -NoTypeInformation
But the script will show only task name and status. I need to generate a report with below details:
VM Name
Snapshot Name
Deletion start time
Deletion end time
User Id use to delete the snap
Anyone help me on this?