Closed ljtill closed 5 years ago
Start-Job
doesn't work in the application-hosting-powershell scenario by design. This is because the out-of-process background job requires pwsh
to be available under $PSHOME
. For an application that hosts PowerShell, it's using the NuGet packages and won't have pwsh
shipped with it. You can use Start-ThreadJob
from the ThreadJob
module. PowerShell Function worker has that module in module path by default.
We updated the error message to make it less confusing. Please see https://github.com/PowerShell/PowerShell/pull/9128
Thanks @daxian-dbw appreciate the quick response!
In the process of building several prototype PowerShell functions and as part of the execution I'm looking to utilize PSJobs. I've hit a error which I'm trying to remediate and determine if it's an issue with my code syntax or the worker. Testing the process flow outside of the function host doesn't seem to throw any errors and returns the expected behavior.
Operating System: macOS 10.14.4 PowerShell Version: 6.2.0 Azure Functions Core Tools: 2.5.553 Function Runtime Version: 2.0.12382.0
When the Receive-Job cmdlet executes I receive the following error in the Console (debug).
Any help / advice would be greatly appreciated!