Azure 调用子runbook会产生术语'\RunbookName.ps1';无法识别为cmdlet、函数、脚本文件或可操作程序的名称

Azure 调用子runbook会产生术语'\RunbookName.ps1';无法识别为cmdlet、函数、脚本文件或可操作程序的名称,azure,azure-automation,azure-runbook,hybrid-runbook-worker,Azure,Azure Automation,Azure Runbook,Hybrid Runbook Worker,我正在尝试做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

我正在尝试做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

我正在尝试使用混合型Worker来测试这一点。我能够成功地测试儿童runbook。你知道这失败的原因吗。我在这里遗漏了什么吗?

一般来说,这应该有用。但是,如果未发布子runbook,则可能会收到此错误消息。是否已发布?

未发布子runbook。我出版了它,在那之后,它成功了。