Can *.ps1 scripts run as background jobs themselves execute *.ps1 scripts?

后端 未结 2 560
予麋鹿
予麋鹿 2021-01-22 19:35

I want to run 15 instances of a script that pipelines 5 scripts together, and so far I\'m missing the pixie dust. I\'ve boiled the problem down to a test case with a master scri

相关标签:
2条回答
  • 2021-01-22 19:44

    You are calling sub_slave.ps1 wrong. This:

    invoke-expression "D:\jobs\sub_slave.ps1 -message $message" 
    

    Should be this:

    D:\jobs\sub_slave.ps1 -message $message
    

    The message was getting evaluated and became multiple arguments.

    0 讨论(0)
  • 2021-01-22 19:55

    Just taking a guess here, but having multiple threads/jobs write to the same file out.txt could be causing issues.

    0 讨论(0)
提交回复
热议问题