I have a script that checks for snapshots and it runs fine. I would like to also have the hostname of snapshot included, but i don't see it in a get-help get-snapshot. Can the hostname be retireved from this command?
$snaps = Get-VM| Get-Snapshot| select VM, Name, Description, Created, SizeGB
Thank you!
Try like this
Get-VM |
Get-Snapshot|
select @{N='VMHost';E={$_.VM.VMHost.Name}},
@{N='VM';E={$_.VM.Name}},
Name, Description, Created, SizeGB
But be aware that this is not necessarily the ESXi node where the VM was running when the snapshot was taken.
This is the ESXi node where that VM is currently running.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VM |
Get-Snapshot|
select @{N='VMHost';E={$_.VM.VMHost.Name}},
@{N='VM';E={$_.VM.Name}},
Name, Description, Created, SizeGB
But be aware that this is not necessarily the ESXi node where the VM was running when the snapshot was taken.
This is the ESXi node where that VM is currently running.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That works perfect. tysm!
Will use it for my almost similar scrypt. Thank you.