VMware Cloud Community
JRabo
Contributor
Contributor

PowerCLI 6.5.2.6 get-vm will not return any vm's, only header.

Running PowerCLI 6.5.2.6  on PowerShell 5.1.14409.  Can not get the cmdlet GET-VM to return anything.  Even when I specify the name of a VM all I get back is the name.  any ideas? worked prior to upgrade and I am in an elevated PowerShell session.

pastedImage_0.png

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

12 Replies
LucD
Leadership
Leadership

What Role does the user you connected with have?
Do you see anything in the Web Client when you connect with that account?

Did you already try to connect with the SSO domain administrator account (default is administrator@vsphere.local)?

Did you already try stopping/starting your PowerShell session?


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

Reply
0 Kudos
JRabo
Contributor
Contributor

The user is in the Administrator role.  I can see everything in the client and it is the account that is used to manage this system for years.  I restarted PS and Prior to upgrading it in PowerShell it work fine as the PowerCLI standalone installer.  I even tried to log into the Host directly with the root account and get the same.

Reply
0 Kudos
LucD
Leadership
Leadership

Are you connecting to a vCenter or to an ESXi node?


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

Reply
0 Kudos
LucD
Leadership
Leadership

Did you uninstall the previous PowerCLI version (the one with the standalone installer) completely before installing the latest version via Install-Module?


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

Reply
0 Kudos
JRabo
Contributor
Contributor

I am connecting to a vCenter server and I have also tried the EXSi host.   Yes I uninstalled the older version.

Reply
0 Kudos
LucD
Leadership
Leadership

Do you have the same behaviour with other cmdlets like Get-VMHost, Get-Datastore, Get-VirtualPortgroup...


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

Reply
0 Kudos
JRabo
Contributor
Contributor

No, those seem to work and return the appropriate data.   Tried to run a script that I use to create vm's and it also failed.  went to a PC with 6.3 installed in it and it worked fine.  Do you know of a clean way to uninstall the PowerCLI modules and start over or do I need to just try and remove the PowerShell (WMF) down to the base included with the OS win7?

Reply
0 Kudos
LucD
Leadership
Leadership

No, you don't need to uninstal PowerSHell, just the old PowerCLI version.

Uninstall PowerCLI via the Programs and Features control panel applet, or eventually via the original MSI or EXE and select the Remove option when prompted.

Also make sure the folder C:\Program Files (x86)\VMware\Infrastructure\PowerCLI is removed.

Then, just to make sure, reboot the station.

When the station is back, do a Find-Module -Name VMware.PowerCLI to check if the connection to the PowerSHell Gallery is ok.

Then do the Install-Module -Name VMware.PowerCLI -Scope CurrentUser

You can also select AllUsers for the Scope parameter.

When the install is completed, you can do a Get-Module -Name VMware* -ListAvailable to check everything is there.


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

Reply
0 Kudos
JRabo
Contributor
Contributor

Well, I did all that originally.  This is where I am at after that.  here is the list that returns from Get-Module.  That is why I was wondering if I should somehow start over, if at all possible.

pastedImage_0.png

Reply
0 Kudos
LucD
Leadership
Leadership

That seems to be ok.
And you are still only getting the header line on all Get- cmdlets (Get-VM, Get-VMHost, Get-Datastore, Get-Datacenter...)?
What do you get when you do a Get-Inventory?


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

Reply
0 Kudos
JRabo
Contributor
Contributor

Get-Inventory returns the inventory just fine.   It seems I only have an issue with Get-Vm and running the script to create vm's.   Get-vmhost and the others will return data.

Reply
0 Kudos
LucD
Leadership
Leadership

I still suspect there might be a missing privilege on your account.
But since you stated that all works perfect in the Web Client, that is unlikely.

You might have discovered a PowerCLI "feature", but then I would suggest to open a SR.


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