Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 246286

Re: Get-VM and Get-Snapshit does not return Host/VMHost

$
0
0

Hi Martin,

 

you are selecting properties from a snapshot object and not from a virtual machine object. A snapshot object has different properties. You can use the following code:

 

Get-VM |Get-Snapshot |Select-Object-Property @{N="VMHost";E={$_.VM.VMHost.Name}},
@{N="VM";E={$_.VM.Name}}, Name, Description, SizeMB,
@{N="DaysOld"; E={((Get-Date) -$_.Created).Days}} |Where-Object {$_.DaysOld -gt7} |Export-Csv"C:\Filename.csv"-NoTypeInformation-UseCulture

Viewing all articles
Browse latest Browse all 246286

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>