Use the "PowerShell Community Extensions" in "After Build Script"
Hey guys,
I'm trying to use the PowerShell Community Extensions in my "After build script", but sadly, this module is not available.
I install it in the "install script" via chocolatey: "choco install pscx";
This is the log of the install script:
6Chocolatey (v0.9.8.27) is installing 'pscx' and dependencies. By
installing you accept the license for 'pscx' and each dependency
you are installing.
7
8pscx v3.2.0
9Downloading pscx 32 bit
10 from 'https://pscx.codeplex.com/downloads/get/923562'
11Installing pscx...
12pscx has been installed.
13pscx has finished successfully! The chocolatey gods have answered
your request!
14Finished installing 'pscx' and dependencies - if errors not shown
in console, none detected. Check log for errors if unsure.
And I get the following error if I try to import the
pscx module:
73Import-Module : The specified module 'pscx' was not loaded
because no valid module file was found in any module directory.
74At line:1 char:1
75+ Import-Module pscx;
76+ ~~~~~~~~~~~~~~~~~~
77 + CategoryInfo : ResourceUnavailable: (pscx:String)
[Import-Module], FileNotFoundException
78 + FullyQualifiedErrorId :
Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
79
80Command executed with exception: The specified module 'pscx' was
not loaded because no valid module file was found in any module
directory.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

Support Staff 1 Posted by Feodor Fitsner on 17 Dec, 2014 09:03 PM
I think the problem is that
PSModulePathis not getting updated by Chocolatey (*or* it's set but not refreshed in the current build session).Get know where that module is being installed and after installation explicitly refresh
PSModulePath:Then try loading the module.
2 Posted by Daniel Häfele on 18 Dec, 2014 07:58 AM
Nice, that seems to have done the trick.
For your interest, here's my code:
Support Staff 3 Posted by Feodor Fitsner on 18 Dec, 2014 08:01 AM
Great, thanks for the update and code snippet!
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.