Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 218483

Freeze when running PowerCLI cmdlets via invoke-command

$
0
0

I'm trying to run a bit of PowerCLI on a remote server using invoke-command. I'm hitting a wall where the execution "hangs" after the connect-viserver cmdlet executes.
I've increased the memory available for remote processes on that server to 2GB (i.e. I've run set-item wsman:localhost\Shell\MaxMemoryPerShellMB 2048 on the remote server and restarted).

 

Remote execution works fine as I can do

 

invoke-command -ComputerName server.bob.com -Scriptblock { get-help}

 

this returns the output from "get-help" as expected

 

Likewise I can load the PowerCLI snap-in and connect to a vSphere host

 

invoke-command -ComputerName server.bob.com -Scriptblock { add-pssnapin VMware.VimAutomation.Core; connect-viserver vsserver.bob.com -User root -Password pwd; get-help}

 

this returns the output from connect-viserver showing that I connected to the host, then the "get-help" output follows as expected

 

The burn comes when I try to run another VMware cmdlet

 

invoke-command -ComputerName server.bob.com -Scriptblock { add-pssnapin VMware.VimAutomation.Core; connect-viserver vsserver.bob.com -User root -Password pwd; get-vmhost}

 

this returns the output from connect-viserver and then just hangs (I have to close the PowerShell instance to get control back). The cmdlet doesn't matter (i.e. get-vm will also hang)

 

The underlying OS is Windows 2008 R2 and I've tried both 5.0 (build 435427) as well as 5.5 PowerCLI (build 1295336) with the same results. Any thoughts?


Viewing all articles
Browse latest Browse all 218483

Trending Articles