Azure 函数 - PowerShell - "The pwsh executable cannot be found at ..."
Azure Functions - PowerShell - "The pwsh executable cannot be found at ..."
当我的 PowerShell Azure Functions 使用门户中的 Test/Run 功能运行时,我在连接的控制台输出中收到此错误。
The pwsh executable cannot be found at "C:\Program Files (x86)\SiteExtensions\Functions.3.1\workers\powershell\runtimes\win\lib\netcoreapp3.1\pwsh.exe"
Note that 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications. Instead, usage of the 'ThreadJob' module is recommended in such scenarios
我的脚本如下所示。
注意 Web 请求的调用确实失败并出现 HTTP 500,触发,我假设 catch
块和 if
。
try {
Invoke-WebRequest ...
}
catch {
$exc = $_;
}
if ($null -ne $exc) {
Writing-Warning "This failed when something blah.";
throw $exc;
}
这就是 gyst。真正的脚本实际上发出了一些 Web 请求,其中任何一个都可能失败。我想确保它们都得到执行,所以我捕获并存储异常,然后只有在最后脚本才能抛出并失败,我希望至少有一个问题会出现在日志记录或某个地方传送门什么的。
实际消息如下所示。对我来说,这听起来像是 Azure 问题。
我只是 运行 它再次出现,它就自行修复了。谢谢你浪费我的时间,Azure。
当我的 PowerShell Azure Functions 使用门户中的 Test/Run 功能运行时,我在连接的控制台输出中收到此错误。
The pwsh executable cannot be found at "C:\Program Files (x86)\SiteExtensions\Functions.3.1\workers\powershell\runtimes\win\lib\netcoreapp3.1\pwsh.exe"
Note that 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications. Instead, usage of the 'ThreadJob' module is recommended in such scenarios
我的脚本如下所示。
注意 Web 请求的调用确实失败并出现 HTTP 500,触发,我假设 catch
块和 if
。
try {
Invoke-WebRequest ...
}
catch {
$exc = $_;
}
if ($null -ne $exc) {
Writing-Warning "This failed when something blah.";
throw $exc;
}
这就是 gyst。真正的脚本实际上发出了一些 Web 请求,其中任何一个都可能失败。我想确保它们都得到执行,所以我捕获并存储异常,然后只有在最后脚本才能抛出并失败,我希望至少有一个问题会出现在日志记录或某个地方传送门什么的。
实际消息如下所示。对我来说,这听起来像是 Azure 问题。
我只是 运行 它再次出现,它就自行修复了。谢谢你浪费我的时间,Azure。