PowerShell, Difference between Start-Job and a hidden Start-Process that calls powershell.exe


This Content is from Stack Overflow. Question asked by YorSubs

I can use Start-Job to run a process in the background for asynchronous / parallel jobs.

However, I could also use Start-Process to create a background process asynchronously.

$command = "choco install openoffice -y"
Start-Process "powershell.exe" -WindowStyle Hidden -ArgumentList "-sta -noprofile -executionpolicy unrestricted $command"

What are the pros and cons to using each method?


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?