Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 546

PowerShell Studio • Background jobs don't work from packaged code and can't get workaround to work

$
0
0
Product, version and build: PowerShell Studio 2023 (64 Bit), v5.8.219
Operating system: Windows 10 Pro (64 Bit), v10.0.22631.0
PowerShell version(s): 5.1 and 7.4.1

Hi,

There seems to be a problem running background jobs from compiled packages (even though the exact same code runs fine from within Powershell Studio), see also https://sapien.com/forums/viewtopic.php?t=16163. (Is there any update on this?)

In that post a workaround is mentioned: start the job with Start-ThreadJob from Powershell 7. So what I did, is install Powershell 7 and in the Add-Jobtracker function of the Job Tracker control set replace "$job = Start-Job" with "$job = Start-ThreadJob".
Now, as expected, this works before compiling. But after compiling and running the executable, the backroung job still isn't started.

Am I implementing the workaround correctly or should I do it differently? Or do you maybe have another way to get background jobs to work from within compiled code?

Thanks in advance,

Chris

Statistics: Posted by JKNederland — Tue Feb 27, 2024 3:49 am



Viewing all articles
Browse latest Browse all 546

Trending Articles