我试图将PowerShell工作流引入一些现有脚本中,以利用并行运行功能。
当前在工作流程中,我必须使用:
Inline
{
Import-Module My.Modules
Execute-MyModulesCustomFunctionFromImportedModules -SomeVariable $Using:SomeVariableValue
}
Run Code Online (Sandbox Code Playgroud)
否则,我会收到错误消息,指出找不到自定义函数。必须有更好的方法来做到这一点?