Release - PSFramework v1.13.414
Just released v1.13.414 of the PSFramework module!
The key feature for this release is the Invoke-PSFRunspace command, beyond which a few minor fixes and tweaks were included:
- New Options for Tab Expansion Scriptblocks: It is now possible to disable automatic filtering (in case you want to do your own), or limit the maximum number of completions shown.
- Waiting for a Runspace Workflow to complete now supports showing a progress bar
Invoke-PSFRunspace
The idea behind this command is to step into the role of both ForEach-Object -Parallel and Start-ThreadJob, granting access to their functionality for both Windows PowerShell (5.1) and later core versions (7.*).
And improve upon it.
A few example usages:
Get-ADUser -Filter * | Invoke-PSFRunspace { $_ | Get-ADPrincipalGroupMembership }
Retrieve all users from Active Directory, then retrieve their group memberships
Get-ADUser -Filter * | Invoke-PSFRunspace { $_ | Get-ADPrincipalGroupMembership } -OutputStyle Result
Retrieve all users from Active Directory, then retrieve their group memberships, returning a report object, mapping each user to their group memberships.
$task = Get-ADUser -Filter * | Invoke-PSFRunspace { $_ | Get-ADPrincipalGroupMembership }
# Collect the data received so far
$task.CollectCurrentResult()
# Wait until completed and collact all remaining results
$task.CollectResult()
First start searching for all users' group memberships. Then later collect some or all the results in convenient result datasets, mapping input to output and including all errors / warnings / etc.
