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.
Thanks for your help,
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
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\""
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\""
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.
PowerCLI Development Team