Powershell script can't find Powershell Community Extensions

When I run the script outside of the Octopus deployment process everything is fine. However, when I run the same script via the library inside Octopus, it says it can’t find term ‘Skip’. It says it isn’t a recognized cmdlet, function, script file, or operable program. What do I need to do to have Octopus make the Powershell Community Extensions available to the script library?

Thanks,
Mike

I should add that the server is running Powershell v3.0.

Hi Mike,

Thanks for reaching out. The scripts get executed on the tentacles. Have you checked if PCEX is installed on the tentacles? Running a tiny get-childitem script on the tentacles (from octopus) to check for the PCEX files might be a good idea.

Thanks!

Dalmiro

Hi Dalmiro,

Actually, I’m still evaluating Octopus. So, in my limited testing environment the tentacle is on the same machine as the Octopus server. I’ve run the script successfully on the same machine, but outside Octopus. It seems like I need to reference PCEX somehow in my script, but I’m not sure how.

I ran get-childitem as part of the deploy process on the tentacle and got this output (if this helps):

Directory:
C:\Windows\system32\config\systemprofile\AppData\Local\Tentacle\Temp
Mode LastWriteTime Length Name


-a— 1/20/2015 4:42 PM 16 599e5b41-4fb2-4552-bdea-e5c8b2844b
84.ps1

OK, I figured it out. I needed to add “C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx” to the environment variable and them put “Import-Module pscx;” in the script. Thanks!

Hi Mike,

Glad you could sort it out! Thanks for posting the fix here as well.

Thanks!

Dalmiro