Hello,
why does Command 1 work but command 2 doesn't:
1:
There is an area dedicated to PowerCLI, expect a moderator to move your thread there, now that I have reported it.
Hello.
Command 1 transfer an object in a remove-snapshot "VMware.VimAutomation.ViCore.Impl.V1.VM.SnapshotImpl"
Command 2 object type "Selected.VMware.VimAutomation.ViCore.Impl.V1.VM.SnapshotImpl"
Cannot convert the value of type "Selected.VMware.VimAutomation.ViCore.Impl.V1.VM.SnapshotImpl" to type "VMware.VimAutomation.ViCore.Types.V1.VM.Snapshot".
Use this example:
$Snapshot = Get-VM | Get-Snapshot | Where-Object -FilterScript {$_.Created -lt $timestamp}
$Snapshot | Select-Object -Property name, vm, Created, SizeGB
$Snapshot | Remove-Snapshot