Search code examples
powershellserviceprocessjobs

Difference between start-process, start-job and start-service of Powershell?


I've read some info:

Still fuzzy about those concepts.

  1. Are they identical to Linux relative concepts? And what are their equivalents in Linux, if exist?
  2. What actually happen on OS level when I use those cmdlet? How am I supposed to choose between them when I want to accomplish something?

Solution

  • First off, these three links should give you as much information as you would need to understand each of these.

    Start-Process
    Start-Job
    Start-Service

    Depending on what you want to accomplish, you can chose the necessary cmdlet.

    Start-Process runs an executable on the system (Notepad, powershell, Sort.exe etc with arguments if needed)

    Start-Job runs processes in the background for asynchronoush / parallel jobs

    and Start-Service starts a windows service (like systemd) "already" configured on the server. This does not create or configure the service, simply starts it.

    Each of the links above provides examples on how to use them as well.