hugop
Hot Shot
Hot Shot

add-module viToolkitExtensions.psm1 fails

!http://communities.vmware.com/message/1071840/Picture 3.png!

Trying to try the ideas in this post but not having any luck adding the viToolkitExtensions.psm1 module.

Help please..

Hugo

0 Kudos
15 Replies
admin
Immortal
Immortal

Hi Hugo,

I don't see the picture for some reason. Do you have PowerShell 2 CTP2 installed? It won't work with CTP1 and unfortunately both versions are still available for download last I checked.

0 Kudos
hugop
Hot Shot
Hot Shot

Here's the text of the error:

PS C:\Program Files\VMware\Infrastructure\VIToolkitForWindows> add-module viTool

kitExtensions.psm1

Add-Module : The specified module 'viToolkitExtensions.psm1' was not loaded bec

ause the module source file was not found in any package directory,

At line:1 char:11

+ add-module <<<< viToolkitExtensions.psm1

PS C:\Program Files\VMware\Infrastructure\VIToolkitForWindows>

Yes I have PowerShell CTP2 V2 and the VI Toolkit for Windows installed.

Thanks

0 Kudos
astrolab
Contributor
Contributor

I can not find the vitoolkitextensions.psm1 on CodePlex or anywhere for that matter, could somebody redirect me to it?

Thank you.

0 Kudos
halr9000
Commander
Commander

The main page: http://www.codeplex.com/vitoolkitextensions

view file: http://www.codeplex.com/vitoolkitextensions/SourceControl/FileView.aspx?itemId=553609&changeSetId=42...

download file: http://www.codeplex.com/vitoolkitextensions/SourceControl/DownloadSourceCode.aspx?changeSetId=42783






[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator

Author of the upcoming book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
Robertrose
Contributor
Contributor

Im getting the same error. Have you been able to resolve this?

Thnaks

Robert

0 Kudos
hugop
Hot Shot
Hot Shot

You need to include the path to the viToolkitExtensions.psm1 file, like so:

Add the viToolkitExtensions

Add-module “C:\coreModule\viToolkitExtensions.psm1”

Hugo

0 Kudos
LucD
Leadership
Leadership

Please note that the latest release of the VITK Extensions is written for PowerShell v2 CTP3.

So you would need to use Import-Module instead of Add-Module.


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

0 Kudos
maishsk
Expert
Expert

I had the same problem , and LucD hit the nail on the head..
Maish

Systems Administrator & Virtualization Architect

Maish Saidel-Keesing • @maishsk • http://technodrone.blogspot.com • VMTN Moderator • vExpert • Co-author of VMware vSphere Design
0 Kudos
hum_mike
Contributor
Contributor

I am having similar issues using the CTP2 version of powershell. However, I am having 2 issues.

1) when I "Initialize-VIToolkitEnvironment.ps1", powershell takes the script but does not apply the alias like get-vicommand, get-vc, etc.

2 when I run the add-module command using the full path of the viToolkitExtensions.psm1, I get the same error as everyone above.

"The specified module 'viToolkitExtensions.psm1' was not loaded because the module source file was not found in any package directory,"

I have tried several different version of viToolkitExtensions.

(42783, 43828, and 45422).

Any Ideas?

0 Kudos
LucD
Leadership
Leadership

From version 45318 onwards you need CTP3 (and Import-Module) to use the Extensions.

Can you check the package path (in CTP2)

$env:PsPackagePath

And eventually try storing the .psm1 file in one of those directories and then try the Add-Module again.

As background info on modules have a look at this blog of Huddled Masses


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

0 Kudos
hum_mike
Contributor
Contributor

Sorry for the delayed response. It has been one fo those weeks.

Which file(s) would that typically be in?

0 Kudos
LucD
Leadership
Leadership

Do you mean $env:PsPackagePath ?

If yes, you enter that from the PowerShell prompt.


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

0 Kudos
hum_mike
Contributor
Contributor

I typed that in and got nothing back.

0 Kudos
LucD
Leadership
Leadership

That would mean the environment variable is not set.

Did you read the blog I mentioned earlier, it explains in detail how to load modules in CTP2.


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

0 Kudos
hum_mike
Contributor
Contributor

That worked !! Once I created the environmental variables for the different directories, I was able to successfully load the module.

Thanks a million.

0 Kudos