VMware Cloud Community
tdubb123
Expert
Expert

slow query

I am trying to run this but it taking a long time

any idea how it can be faster?

get-vm -name (get-content .\vms.txt) | select Name, vmhost, @{n="vendor";e={ (get-vm -name $_ | get-vmhost).ExtensionData.summary.hardware.vendor}}, @{n="model";e={(get-vm -name $_ | get-vmhost).extensiondata.summary.hardware.model}}

0 Kudos
1 Reply
LucD
Leadership
Leadership

Try this version

Get-VM -Name (Get-Content .\vms.txt) |

select Name,

   @{N='vmhost';E={$_.VMHost.Name}},

   @{N="vendor";E={$_.VMHost.ExtensionData.summary.hardware.vendor}},

   @{N="model";E={$_.VMHost.extensiondata.summary.hardware.model}}

If that isn't fast enough, we can also try to go to Get-View.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos