PowerShell 7 introduced a much needed feature for running pipeline input in parallel.
The documentation for PowerShell 7 does not provide any detail on how this is implemented.
Having leveraged PoshRSJob
and Invoke-Parallel
modules before, I'm aware that runspaces were traditionally considered the much more efficient approach for parallel operations in powershell over running PowerShell jobs. I've read some mixed content indicating that this is using threading now and not runspaces, but can't find anything else specific.
I'd really appreciate some technical insight into:
- What is the lifecycle of an execution from a .NET perspective
- Is the new functionality runspaces or threads? (or is a runspace just a .NET thread in System.Management.Automation?)
- Does this bring about any complexity in traditional debugging now that we are moving into parallel operations? Historically I had a rough time debugging with runspaces, and not sure what options might have been improved