Powershell pass variable to start-job
To complement Keith Hill’s helpful answer with a PSv3+ alternative: The $using: scope modifier can be used to reference the values of variables in the caller’s scope inside the script block passed to Start-Job, as an alternative to passing arguments (by default, a script block executed as a background job does not see any of … Read more