How do I remotely run a Powershell workflow that uses a custom module?
- by drawsmcgraw
I have a custom Powershell module that I wrote for various tasks. Now I want to craft a workflow whose activities will use commands from the module. Here's my test workflow:
workflow New-TestWorkflow{
InlineScript {
Import-Module custom.ps1
New-CommandFromTheModule
}
}
Then I run the workflow with:
New-TestWorkflow -PSComputerName remoteComputer
When I do this, the import fails because it can't find the module. I imagine this is because the workflow is executing on the remote machine, where my module does not exist.
I can see myself running this across many machines so I'd really rather not have to install this module and maintain it on all of the machines. Is there some way to have my module in a central place and use it in workflows?