Created
January 26, 2025 21:22
-
-
Save StartAutomating/b71376cfcad48e271ba19410ab650381 to your computer and use it in GitHub Desktop.
Gist showing how to declare functions in a background job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start-ThreadJob {param($V) | |
foreach ($kv in $v.GetEnumerator()) { | |
$ExecutionContext.SessionState.PSVariable.Set($kv.Key, $kv.Value) | |
} | |
testing | |
} -Arg @{'function:testing' = {1..3}} | Wait-Job | Receive-Job |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment