Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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?

share|improve this question
up vote 0 down vote accepted

Looking at this article, I need to use -PSRequiredModules at the end of the activity, which in this case is the entire InlineScript. So...

workflow New-TestWorkflow{
    InlineScript {
    } -PSRequiredModules custom

Tragically, I can't test it from where I am but my recent experience tells me that this is what I would need to do.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.