Guys,
Does anyone have a PowerShell script that could get all VM's with a particular virtual hardware version (VM version 4 in this instance) and output it to a excel file (or any type file really)?
Thanks.
Try this
Get-VM | where{$_.Extensiondata.Config.Version -eq "vmx-04"} | Select Name | Export-Csv "C:\VM-HW4.csv" -NoTypeInformation
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try this
Get-VM | where{$_.Extensiondata.Config.Version -eq "vmx-04"} | Select Name | Export-Csv "C:\VM-HW4.csv" -NoTypeInformation
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can use Alan Renouf's vCheck script from www.virtu-al.net. That script returns vm's with hardware version 4.
Regards, Robert
You can also use this script, since it's much faster than retrieving the ExtensionData property:
# You can specify either "v4" or "v7" for hardware version Get-VM | where {$_.Version -eq "v4"} | select name
-
PowerCLI development team