If you ever need to run a task in the background or have multiple smaller tasks that you want to run in parallel, you can use PowerShell jobs. Jobs are blocks of code that run in their own PowerShell instance, and you can retrieve the output at any point and even stop the job when required. Let’s say you need to write a script that needs to connect to all computers on a network and retrieve their operating system version to build a report. Doing this task individually could take a very long time, but if you could run ten of these ...
15. Background Processing
Get PowerShell for Beginners: Learn PowerShell 7 Through Hands-On Mini Games now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.