VMware Cloud Community
dgreebe
Contributor
Contributor
Jump to solution

PowerCLI won't work after clean, fresh installation

Hi All,

I was working on some nice Powershell scripts but after my laptop crash I cannot seem to get it working anymore.

Several clean, fresh installations of Windows 10 still i get errors;

my steps;

Installing Windows feature .NET 3.5 and .NET 4.5

In Powershell, I set the executionpolicy to unrestricted

Executing VMware-PowerCLI-6.3.0-3737840

After installation, I start PowerCLI, but the command connect-viserver is not available.

Even though I have issues, I still want to install VIToolkit (VMware-Vim4PS-1.5.0-142961)

After I've done that all, I want to start but all my modules are failing.
I do see them in

Get-Module -ListAvailable

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Binary     6.0.0.0    VMware.VimAutomation.Cis.Core

Binary     6.3.0.0    VMware.VimAutomation.Cloud

Manifest   6.3.0.0    VMware.VimAutomation.Common

Manifest   6.3.0.0    VMware.VimAutomation.Core

Binary     6.0.0.0    VMware.VimAutomation.HA

Binary     1.0.0.0    VMware.VimAutomation.License

Binary     6.0.0.0    VMware.VimAutomation.PCloud

Manifest   6.3.0.0    VMware.VimAutomation.SDK

Binary     6.0.0.0    VMware.VimAutomation.Storage

Binary     6.3.0.0    VMware.VimAutomation.Vds

Binary     6.3.0.0    VMware.VimAutomation.vROps

Binary     6.0.0.0    VMware.VumAutomation

When I load a script that will import them, I get the following errors;

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.Cloud

Import-Module : Could not load file or assembly 'VMware.VimAutomation.ViCore.Types, Version=6.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

At line:1 char:1

+ Import-Module VMware.VimAutomation.Cloud

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.Common

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.Core

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.HA

Import-Module : Could not load file or assembly 'VMware.VimAutomation.ViCore.Util10Ps, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

At line:1 char:1

+ Import-Module VMware.VimAutomation.HA

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.License

Exception calling "OnImportModule" with "2" argument(s): "A provider is not available for the following required component service: ViCoreService"

At C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules\VMware.VimAutomation.License\Initialize-SDKComponent.ps1:1 char:1

+ [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NotSupportedException

Import-Module : Could not load file or assembly 'VMware.VimAutomation.ViCore.Util10Ps, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

At line:1 char:1

+ Import-Module VMware.VimAutomation.License

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.PClou

Import-Module : The specified module 'VMware.VimAutomation.PClou' was not loaded because no valid module file was found in any module directory.

At line:1 char:1

+ Import-Module VMware.VimAutomation.PClou

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (VMware.VimAutomation.PClou:String) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.PClou

Import-Module : The specified module 'VMware.VimAutomation.PClou' was not loaded because no valid module file was found in any module directory.

At line:1 char:1

+ Import-Module VMware.VimAutomation.PClou

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (VMware.VimAutomation.PClou:String) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\Dave Greebe\Dropbox\Powershell_Scripts\PowerScripts_trunk\Single scripts> Import-Module VMware.VimAutomation.PCloud

Import-Module : Could not load file or assembly 'VMware.VimAutomation.ViCore.Types, Version=6.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

At line:1 char:1

+ Import-Module VMware.VimAutomation.PCloud

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

I really don't understand this why its failing.

Hope that someone can help me with this...

Thanks in advance

Dave Greebe

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

But you don't need that, that is in fact a (very) old predecessor of the current PowerCLI.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

Did you check your $env:PSModulePath?

Does it load the PowerCLI modules correctly when you use the PowerCLI shortcut?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dgreebe
Contributor
Contributor
Jump to solution

When using the PowerCLI shortcut I also get errors.

When I installed PowerCLI 6.3 R1, I first started it but the command connect-viserver was not available.

My $env:PSModulePath:

C:\Users\dave.greebe\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\;C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules

That looks like it is OK.

Also i see the VMWare modules when running Get-Module -ListAvailable

    Directory: C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Binary     6.0.0.0    VMware.VimAutomation.Cis.Core

Binary     6.3.0.0    VMware.VimAutomation.Cloud

Manifest   6.3.0.0    VMware.VimAutomation.Common

Manifest   6.3.0.0    VMware.VimAutomation.Core           HookGetViewAutoCompleter

Binary     6.0.0.0    VMware.VimAutomation.HA

Binary     1.0.0.0    VMware.VimAutomation.License

Binary     6.0.0.0    VMware.VimAutomation.PCloud

Manifest   6.3.0.0    VMware.VimAutomation.SDK

Binary     6.0.0.0    VMware.VimAutomation.Storage

Binary     6.3.0.0    VMware.VimAutomation.Vds

Binary     6.3.0.0    VMware.VimAutomation.vROps

Binary     6.0.0.0    VMware.VumAutomation

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The ExportedCommands property doesn't show a lot 😞

Just to confirm, does this return cmdlets ?

Get-Command -Module VMware.VimAutomation.Core

Which Windows 10 version is that, the recent Anniversary Update?

Do a

[System.Environment]::OSVersion.Version


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dgreebe
Contributor
Contributor
Jump to solution

Hi LucD,

PS P:\> Get-Command -Module VMware.VimAutomation.Core

PS P:\> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision

-----  -----  -----  --------

10     0      10586  0

I do now see that no cmdlets are in the module...

I removed all VMWare modules and everthing that is related to PowerCLI, and I've checked if nothing is loaded or seen by powershell, and nothing is shown..

PS P:\> Get-Module -ListAvailable | where Name -like vmware*

PS P:\>

I've started to install PowerCLI first and installation went fine.

Starting PowerCLI....

and suddenly I don't have errors or issues..

I now also can run Connect-viserver.

I think that the main issue was, that there were still modules installed or connected. Now I;ve removed everything regarding PowerCLI and/or VMWare.

I'll check further if everything is working. Now have to install VIToolkit and test my scripts.

Reply
0 Kudos
dgreebe
Contributor
Contributor
Jump to solution

okay, well... after PowerCLI installation, I could execute Connect-viserver,

but after installation of the VIToolkit everything was broken again, and now running the PowerCLI-shell I'm having issues like before.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

What do you mean by the VIToolkit?

Do you have a link?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dgreebe
Contributor
Contributor
Jump to solution

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

But you don't need that, that is in fact a (very) old predecessor of the current PowerCLI.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dgreebe
Contributor
Contributor
Jump to solution

O, I though I had to use it because of some cmdlets for vmtools.

In that case I skip that and finaly I can use it...

thanks for you help!

Reply
0 Kudos
genevt
Contributor
Contributor
Jump to solution

Have you tried launching PowerCLI as Administrator on your workstation?  I just installed today and had errors when not running it as Administrator.  Once I did that, all errors went away.

Reply
0 Kudos