I have Powershell job.
$cmd = {
param($a, $b)
$a++
$b++
}
$a = 1
$b = 2
Start-Job -ScriptBlock $cmd -ArgumentList $a, $b
How to pass $a
and $b
by a reference so when the job is done they will be updated? Alternatively how to pass variables by reference to runspaces?