VMware.vim error when trying to open PowerCLI 5.0

I updated PowerCLI to 5.0 on my machine (Win 7 x64 - PowerCLI previous version worked fine), and now when I open PowerCLI, it just opens and closes.  A closer look revealed the following error on the "LoadWithPartialName" line in the script:

PS C:\Users\user> [void][Reflection.Assembly]::LoadWithPartialName("VMware.Vim")

Exception calling "LoadWithPartialName" with "1" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E
At line:1 char:49
+ [void][Reflection.Assembly]::LoadWithPartialName <<<< ("VMware.Vim")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

I then even tried just to load the snap-in, and got the following error:

PS C:\Users\user> Add-PSSnapin Vmware.VimAutomation.Core
Add-PSSnapin : Could not load file or assembly 'VMware.Vim, Version=, Culture=neutral, PublicKeyToken=10980b081e
887e9f' or one of its dependencies. Access is denied.
At line:1 char:13
+ Add-PSSnapin <<<<  Vmware.VimAutomation.Core
    + CategoryInfo          : NotSpecified: (:) [Add-PSSnapin], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddPSSnapinCommand

I am obviously an administrator on my machine, RemoteSigned is enabled in PowerShell, and I've completely uninstalled and re-installed PowerCLI but still have the same error.

Does anyone now how to correct this?

0 Kudos
1 Reply

Did you try this on another client and did it give the same error ?

You could try starting procmon from SysInternals and try to find out where the "access denied" actually comes from.

Blog:  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos