VMware Cloud Community
Ranger275
Contributor
Contributor

PowerCLI 4.1 Opens and Closes on 2008 R2 Server

I have read the communities for years and normally find the answer to all my ills here. Unfortunately I cannot find an answer and even the mighty Google doesn't seem to help. Here goes my first post...

I have a VM I work from. I call it my toolbox. I load all my programs, tools, and settings to it. No matter where I go, I can RDP to it and get to work fast. I recently spun up a 2008 R2 VM and loaded vSphere PowerCLI 4.1. When it launches, it opens and quickly closes. I have tried running the commands that are found in the PowerCLI shortcut from a PowerShell 2.0 prompt to no avail. I can run commands in PowerGUI Script Editor and that works like a champ. The supported OS doc says Server 2008 is supported, but there is no mention of 2008 R2. Windows 7 is supported so I just figured that 2008 R2 would be OK. I can't find a smoking gun in the Event logs. I also tried installing in compatibility mode. No luck.

Any ideas?

Thanks for your help,

Sean

Tags (2)
23 Replies
admin
Immortal
Immortal

Hi there,

you can try to modify your PowerCLI short-cuts by:

1. Removing -psc portion from the Target filed

2. Add "Add-PSSnapin" call into -command argument

Old value:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\""

New value

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c "Add-PSSnapin VMware.VimAutomation.Core; . \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\""

Vitali

PowerCLI team

nnedev
VMware Employee
VMware Employee

Hi,

You are running 2008R2 Server right?

Can you please verify that:

1. You are able to load PowerCLI snapin

2. Run with no error the Initialize-VIToolkitEnvironment.ps1 script with no errors.

3. You are able to load the console file vim.psc1 with double click.

You can read the previous posts to get more information how to do it.

Regards,

Nedko Nedev

PowerCLI Development Team

Regards, Nedko Nedev PowerCLI Development Team
0 Kudos
hayb
Contributor
Contributor

Vitalibaruh,

I am happy to announce that your solution solved my problem. With a minor change of setting the PS execution policy, everything worked! Smiley Happy

0 Kudos
davidstamen
Contributor
Contributor

Thanks this resolved my issue!

0 Kudos