USHPCVDI
Enthusiast
Enthusiast

connect-viserver freezes powershell

This annoying problem seems to have started after I reinstalled PowerCLI from the powershell gallery (via install-module) vs the installer they used to use. Every time I type in connect-viserver server name, it seems to try to connect, then stops. Powershell prompt is also frozen, I can't even move the window let alone close it. Need to use task manager to kill powershell.exe. I don't have anything being loaded from my _profile.ps1 file. I've made sure no other installs of PowerCLI show up in Uninstall Programs. And try deleting the modules from C:\Program Files\WindowsPowerShell\Modules and then reinstalling 6.5.1 via install-module -name VMware.PowerCLI. I'm connecting to a 6.5 vCenter instance as well. I'm out of ideas.

Has anyone had this problem or can help?

Thanks.

0 Kudos
10 Replies
LucD
Leadership
Leadership

No, not really.

Could be that auto loading is still busy.
Can you try to do this before you do the Connect-VIServer?

Get-Module -Name VMware* -ListAvailable | Import-Module

Do you have a lot of other modules installed?

Are there many folders in your $env:PSModulePath?


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

0 Kudos
USHPCVDI
Enthusiast
Enthusiast

I tried loading those modules as you suggested, but no change. I can't even minimize or move the powershell window, normally when it's busy I can still do those functions. Also only have 3 paths in my modulepath variable. Looking at other modules, nothing else except the ones that are installed by default.

0 Kudos
LucD
Leadership
Leadership

Any chance you could try PowerCLI 6.5.1 on a fresh station, no previous PowerCLI versions installed?

And which PowerShell version do you have on the problematic station (do a $env:PSVersionTable)?


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

0 Kudos
USHPCVDI
Enthusiast
Enthusiast

Version table is the following.

Major  Minor  Build  Revision

-----  -----  -----  --------

5      0      10586  117

Will try to find somewhere to test a fresh install.

0 Kudos
LucD
Leadership
Leadership

Can you also try adding the Verbose switch to the Connect-VIServer cmdlet?


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

0 Kudos
USHPCVDI
Enthusiast
Enthusiast

Does not display anything. However if I give connect-viserver a bogus address to connect to, it does not freeze powershell and gives a normal error of could not resolve the requested VC server.

0 Kudos
LucD
Leadership
Leadership

Could there be any firewalls between your station and the vCenter?

Were you able to try on a freshly installed station?

Could there be a TLS handshake issue?

Which vSphere version is that?

Can you start a network trace, something like Wireshark for example?


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

0 Kudos
jakerpowercli
VMware Employee
VMware Employee

do you get any additional info when you use `-verbose`?

0 Kudos
USHPCVDI
Enthusiast
Enthusiast

Well no idea why but it's working. No changes on my VDI workstation, no log off or reboot. Even had the same powershell window open. Not aware of any firewalls in between the two subnets either. Thanks for the help though, wish I could find out why. I'll come back here if I do figure out why.

Thanks.

0 Kudos
LucD
Leadership
Leadership

VDI workstation?

I didn't know that, could your VDI station have been vMotioned?

Perhaps only one or a few of your ESXi nodes show the issue?


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

0 Kudos