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
Can you load the PowerCLI snapin from the PS v2 prompt ?
Add-PSSnapin VMware.VimAutomation.Core
I suppose so since PowerGui works.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It looks like it loads. I am still unable to launch from the PowerCLI shortcut.
Windows PowerShell
+ Copyright (C) 2009 Microsoft Corporation. All rights reserved.+
+ PS H:\> add-pssnapin vmware.vimautomation.core+
+ PS H:\>+
Did you try executing the Initialize-VIToolkitEnvironment.ps1 script (in the Scripts directory) from the PS v2 prompt (after you loaded the snapin) ?
Perhaps the
[void][http://Reflection.Assembly|http://Reflection.Assembly]::LoadWithPartialName("VMware.Vim")
is causing the problem.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Looks like we are getting somewhere.
Hi Sean,
Can you try something which may help us to understand the reason for that problem?
1. Choose properties on PowerCLI shortcut and copy the value from Target field on Shortcut page.
2. Start cmd.exe
3. Paste the command and run it
4. Show us the error that you see (if there's a error)
There should be two PowerCLI shortcuts on your desktop (PowerCLI and PowerCLI 32 bit).
Did you try to run both? Do both of them open and close?
Thanks,
Vitali
PowerCLI team
Isn't this due to the security policy ?
That script is a signed script, did you do a
Set-SecurityPolicy RemoteSigned
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Vitali,
Here you go and yes they both open and close. I also spun up another 2008 R2 VM and only installed PowerCLI 4.1 and got the same result. Thank you for the help.
VMware vSphere PowerCLI Shortcut C:\Windows\system32>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc "D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"D:\Program Files (x86)\VMware\I nfrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\"" Internal Windows PowerShell error. COM initialization failed while reading Windows PowerShell conso le file with error 80010106. |
VMware vSphere PowerCLI (32-Bit) Shortcut C:\Windows\system32>C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psc "D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"D:\Program Files (x86)\VMware\I nfrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\"" Internal Windows PowerShell error. COM initialization failed while reading Windows PowerShell conso le file with error 80010106. |
LucD - Do you mean set-executionpolicy remotesigned?
Yes, sorry for the typo
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Sean,
It is possible this problem to be related in some way with the VIX component on which PowerCLI depends. Can you confirm that you have the latest version of it 1.10?
To check that , go to the VIX installation folder and see the version of VixCom.dll (properties of the file). The installation folder should be %Program Files%\Vmware\Vmware VIX\
The official page of VIX component is:
http://www.vmware.com/support/developer/vix-api/
Vitali
Here are the properties.
Hi again,
Your version of VIX is correct.
I'm still unable to reproduce the situation on windows 2008 R2 server.
1. Can you try to run the shortcut as administrator?
or
2. Uninstall the VIX component and install it again
Vitali
Run as Administrator was no luck.
Add/Remove Programs had VMware VIX version at 1.10.0.12331. I found a new version on VMware.com.
I installed VMware VIX version 1.10.1.12915. Still no luck trying to launch PowerCLI.
Hi,
I have some thoughts on the problem. Here are the areas that we should investigate:
1. PowerCLI snapin - already checked. You are able to load our snapin in PS console 2. Initilize-VIToolkitEnvironment script - already checked. You running the scripts with no erros.
3. PowerCLI console file - Go to PowerCLI installation folder and doubleclick on the vim.psc1 file. Verify that a new powershell popup window appears and PowerCLI snapin is loaded 4. PowerCLI shortcut - send us the shortcut file (VMware vSphere PowerCLI.lnk)
Regards,
Nedko Nedev
PowerCLI Development Team
3. PowerCLI console file - Go to PowerCLI installation folder and
doubleclick on the vim.psc1 file. Verify that a new powershell popup
window appears and PowerCLI snapin is loaded
I had this file associated with PowerGui Script Editor. I changed it to PowerShell and double clicked. A command window appeared and vanished.
4. PowerCLI shortcut - send us the shortcut file (VMware vSphere PowerCLI.lnk)
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc "D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"D:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\""
removed
Thank you to everyone for your help. I rebuilt another box from scratch and don't have any issues. Something happened along the way and it was easier to rebuild than continue trying to troubleshoot.
Thanks again,
Sean
I'm posting the fix in case someone has the same issue:
The problem was in your console file. You need to generate it again with the following steps:
1. Open powershell console and add PowrCLI snapin
2. Use the Export-Console cmdlet to generate a console file containing loaded snapins
3. Replace the file <PowerCLI install dir>\vim.psc1 with the newly created console file
This will solve the issue.
Regards,
Nedko Nedev
PowerCLI Development Team
I had the same problem.
I have attempted the solution Nedko / nnedev offered. It has not worked.
Any more ideas would be of help, i am determined to get PowerCLI working :smileygrin: