Steps to reproduce
$iter = 10
$env:PSModulePath = 'Custom PSModulePath'
Measure-Command {
for( $i = 0; $i -lt $iter; $i++ )
{
$job = start-job -ScriptBlock { Write-Host $env:PSModulePath }
}
}
Expected behavior
I should be able to kick off ten jobs in just a few seconds (maybe 2 or 3). When the results of the job come in, I should see Custom PSModulePath. This is the behavior in 5.1.
Actual behavior
It takes between 12 and 20 seconds. That's longer than a second per job! (and I'm not waiting for the job to finish; this is just the time for Start-Job to return) And then the output is the default module path.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.4
PSEdition Core
GitCommitId 6.1.0-preview.4-26-g668ce91ddb14d71177b4de4f94d99c3e429e4ff7
OS Microsoft Windows 10.0.17692
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Expected behavior
I should be able to kick off ten jobs in just a few seconds (maybe 2 or 3). When the results of the job come in, I should see
Custom PSModulePath. This is the behavior in 5.1.Actual behavior
It takes between 12 and 20 seconds. That's longer than a second per job! (and I'm not waiting for the job to finish; this is just the time for
Start-Jobto return) And then the output is the default module path.Environment data