调用子 Runbook 结果 The term '.\RunbookName.ps1' is not recognized as name of a cmdlet, function, script file, or opable program
Calling child runbook results in The term '.\RunbookName.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program
我正在尝试使用儿童 Runbook 进行 POC。作为此 POC 的一部分,我创建了一个简单的 Runbook Child.ps1,内容如下:
Param(
[string]$FolderPath
)
$path = $FolderPath
if(! (Test-Path $path))
{
New-Item -Type dir -Path $path
Write-Output "Created directory '$path'"
}
else
{
Write-Output "Directory '$path' already exists"
}
和父 Runbook,它通过传递参数调用子 Runbook,如下所示:
.\Child.ps1 -FolderPath "C:\TestPath"
当我测试父 Runbook 时出现以下错误:
.\Child.ps1 : The term '.\Child.ps1' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ .\Child.ps1 -FolderPath "C:\TestPath"
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\Child.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我正在尝试使用 Hybrid Worker 对此进行测试。我能够成功测试子 runbook。任何想法为什么会失败。我在这里遗漏了什么吗?
一般来说,这应该可行。但是,如果未发布子 Runbook,您可能会收到此错误消息。发表了吗?
我正在尝试使用儿童 Runbook 进行 POC。作为此 POC 的一部分,我创建了一个简单的 Runbook Child.ps1,内容如下:
Param(
[string]$FolderPath
)
$path = $FolderPath
if(! (Test-Path $path))
{
New-Item -Type dir -Path $path
Write-Output "Created directory '$path'"
}
else
{
Write-Output "Directory '$path' already exists"
}
和父 Runbook,它通过传递参数调用子 Runbook,如下所示:
.\Child.ps1 -FolderPath "C:\TestPath"
当我测试父 Runbook 时出现以下错误:
.\Child.ps1 : The term '.\Child.ps1' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ .\Child.ps1 -FolderPath "C:\TestPath"
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\Child.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我正在尝试使用 Hybrid Worker 对此进行测试。我能够成功测试子 runbook。任何想法为什么会失败。我在这里遗漏了什么吗?
一般来说,这应该可行。但是,如果未发布子 Runbook,您可能会收到此错误消息。发表了吗?