VMware Cloud Community
vmk2014
Expert
Expert
Jump to solution

Looking for lists of VM running on ESXi host from power cli

Hi,

I want to export the lists of VM running on the respective host in a cluster but it throws error after running the command.

Get-Host esx011 | Get-VM

PowerCLI C:\> get-host esx011 | Get-VM

Get-Host : A positional parameter cannot be found that accepts argument

'usjacpvesx011'.

At line:1 char:1

+ get-host esx011 | Get-VM

+ ~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Get-Host], ParameterBindin

   gException

    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell

   .Commands.GetHostCommand

Any idea where i need to correct. I want to export in csv

Thanks

vm2014

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Shouldn't that be Get-VMHost ?


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Shouldn't that be Get-VMHost ?


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

0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

   My mistake. i was giving wrong command. Thanks for correcting me

Thanks

vm2014

0 Kudos