功能不会加载到工作流程中
当我使用工作流程时,只有在工作流中直接调用的函数从调用脚本加载。
当点传动以下脚本并调用主功能时,我将获得以下输出:
function First-Function($Param){
Write-Output "In A: $Param"
}
function Second-Function(){
Write-Output "In B!"
First-Function "Testparam"
}
function Main-Function(){
Workflow Test-Workflow{
Second-Function
}
Test-Workflow
}
When I use a Workflow, only the functions directly called in the Workflow get loaded from the calling script.
When dot-sourcing the following script and call Main-Function, I get the following output:
function First-Function($Param){
Write-Output "In A: $Param"
}
function Second-Function(){
Write-Output "In B!"
First-Function "Testparam"
}
function Main-Function(){
Workflow Test-Workflow{
Second-Function
}
Test-Workflow
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论