The issue lies with the Start-Job command being hosted in other applications, such as packaged scripts from our SAPIEN Script Packager.
As stated in the forum post mentioned, Start-Job depends on the PowerShell executable to be available under $PSHOME to start an out-of-process background job, but when an application is hosting PowerShell, it’s directly using the PowerShell NuGet SDK packages and won’t have PowerShell executable shipped along.
Start-ThreadJob has similar issues when packaged. At the moment, the only workaround is to package with Windows PowerShell (V5).
As stated in the forum post mentioned, Start-Job depends on the PowerShell executable to be available under $PSHOME to start an out-of-process background job, but when an application is hosting PowerShell, it’s directly using the PowerShell NuGet SDK packages and won’t have PowerShell executable shipped along.
Start-ThreadJob has similar issues when packaged. At the moment, the only workaround is to package with Windows PowerShell (V5).
Statistics: Posted by brittneyr — Fri Mar 01, 2024 3:30 pm