Product: PowerShell
Version: 7.4.4
Product: PowerShell Universal
Version: 4.3.2
I’m trying to interact with an application I’m running on a server running the EventHubClient, but I’m getting a failure when I try to run the job due to start-job and start-threadjob not being supported. I’m fairly certain this had been working previously, but when I send the script from my PSU server to the EventHubClient the script died when trying to run a job unless I caught these errors.
The term 'start-threadjob' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The pwsh executable cannot be found at "C:\Program Files (x86)\PowerShell Universal Event Hub Client\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.
What is the recommended method of running jobs from a script executed by an EventHubClient? I’m running both the start-job and start-threadjob commands with name, scriptblock and argumentlst params, and they run as expected when executed from VSCode on the system running the EventHubClient.