Multithreading In Powershell

Andy Levy shows how to use the PoshRSJob module to implement multithreaded Powershell solutions:

Let’s say you’ve got a lot of RSJobs. Or maybe long-running RSJobs. Wouldn’t a nice, user-friendly view of the progress be handy? You bet it would!

This is both dense and verbose, but I wrote it really quickly and it works (but not just for this post, I’ve used it in production), so I’m not tinkering too much with it right now. Once the jobs are created (and a few have started), this script runs a loop watching the output of Get-RSJob and updates a progress bar to reflect where we are. It also takes care of receiving and removing the completed jobs.

This is pretty easy to work with—or at least Andy makes it look that way.

Related Posts

Powershell and Windows Terminal Profiles

Jeffery Hicks shows how you can modify your Windows Terminal profile using Powershell: I recently updated my Windows 10 systems to the 1903 release. One of the reasons is that I wanted to try out the new Windows Terminal preview. You can find it in the Windows Store. This is bleeding edge stuff and far […]

Read More

Using Show-Command in Powershell

Kenneth Fisher walks through the Show-Command cmdlet in Powershell: Years ago I blogged about how I like to use the SSMS scripting feature to learn how to do things. Well now I’m starting to learn Powershell and it turns out there is a GUI here as well that will help me learn to script. At least […]

Read More

Categories

December 2018
MTWTFSS
« Nov Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31