Link to home
Start Free TrialLog in
Avatar of BCSITS
BCSITS

asked on

Unable to import VMware powershell module

Hi All,

I am trying to import VMware modules into my local PC's powershell but when i run "Add-PSSnapin VMware.VimAutomation.Core" it comes back with an error.

I have VMware vpshere client installed but not PowerCLI.  

Can anyone please tell me where i can import vmware modules from?

I am running Windows 7 with PS ver. 3.0

Thanks in advance
Avatar of Derek Schauland
Derek Schauland
Flag of United States of America image

What is the text of the error you are getting when adding the snapin?
Avatar of BCSITS
BCSITS

ASKER

Hi Derek,  here is the output:

Import-Module : The specified module 'vmware.vimautomation.core' was not loaded because no valid module file was found
in any module directory.
At line:1 char:1
+ Import-Module vmware.vimautomation.core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (vmware.vimautomation.core:String) [Import-Module], FileNotFoundExc
   eption
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Thanks,
I think the VMware cmdlets are still provided in a snap in which requires add-pssnapin to be used rather than import-module

An example can be found here http://wannemacher.us/?p=341
Avatar of BCSITS

ASKER

Here is the same error message when i try Add-PSSAnapin vmware.vimautomation.core

Add-PSSnapin : The Windows PowerShell snap-in 'vmware.vimautomation.core' is not installed on this computer.
At line:1 char:1
+ Add-PSSnapin vmware.vimautomation.core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (vmware.vimautomation.core:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
And the downloadable installer was run as an admin?
Avatar of BCSITS

ASKER

do you mean for the vsphere client?  if so, then yes.  powercli is not installed on my machine though.  does it need to be?

i am running powershell as admin too.
Avatar of BCSITS

ASKER

i have installed PowerCLI on my machine and i am now able to add the required snapin.
ASKER CERTIFIED SOLUTION
Avatar of Derek Schauland
Derek Schauland
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BCSITS

ASKER

thanks for your help