Skip to Main Content
Learn PowerShell Core 6.0
book

Learn PowerShell Core 6.0

by David das Neves, Jan-Hendrik Peters
July 2018
Beginner content levelBeginner
552 pages
13h 18m
English
Packt Publishing
Content preview from Learn PowerShell Core 6.0

Parallel execution

When you are confident that you have really eked out the maximum performance from your ForEach loop, there might still be room for improvement through parallelization. Usually, your beefy developer/operations machine laughs at your scripts, so you might as well use some more CPU cycles and some additional memory.

The most common approach to parallelization is to use the job cmdlets and work with the System.Management.Automation.Job objects. This yields good results but requires you to manage the jobs and their output properly. You will not be able to change variables in your scope from within your running jobs.

When working remotely in Invoke-Command, parallelization happens out of the box. This can be controlled by modifying ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PowerShell and WMI

PowerShell and WMI

Richard Siddaway

Publisher Resources

ISBN: 9781788838986Supplemental Content