Powershell build step calling a custom mudule fails with CommandNotFoundException
I have a number of custom powershell modules which i have installed on all of the TC buld agants. I have modified the $env:PSModulePath at the machine level on all of the build agents to include all of these modules for all users. I can invoke all of the individual commands on the build agents. I also have a powershell build step whose job it is to invoke one of these commands. However, each time the build step executes I recieve an exception of CommandNot found. Can anyone shed any light on this?
I should also mention that I have wrapped my command in a try catch to display the error output in the build log. That is how I know what the exception is (see below). Also if I get the build step to invoke Get-Module -ListAvailable my custom modules are not present.
Please sign in to leave a comment.
I have restarted the machines that act as build servers. My modules are now visable to the powershell environment that the build agents envoke.