!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
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.
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
I can not find the vitoolkitextensions.psm1 on CodePlex or anywhere for that matter, could somebody redirect me to it?
Thank you.
The main page: http://www.codeplex.com/vitoolkitextensions
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)
Im getting the same error. Have you been able to resolve this?
Thnaks
Robert
You need to include the path to the viToolkitExtensions.psm1 file, like so:
Add the viToolkitExtensions
Add-module “C:\coreModule\viToolkitExtensions.psm1”
Hugo
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
I had the same problem , and LucD hit the nail on the head..
Maish
Systems Administrator & Virtualization Architect
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?
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
Sorry for the delayed response. It has been one fo those weeks.
Which file(s) would that typically be in?
Do you mean $env:PsPackagePath ?
If yes, you enter that from the PowerShell prompt.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I typed that in and got nothing back.
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
That worked !! Once I created the environmental variables for the different directories, I was able to successfully load the module.
Thanks a million.