Closed ninmonkey closed 3 years ago
Splat is outputting this
$forEachObjectSplat = @{ Parallel = -Parallel } Get-Process | ForEach-Object @forEachObjectSplat {
-parallel should splat as a bool
-parallel
bool
Use ConvertTo-SplatExpression on the For-EachObject
ConvertTo-SplatExpression
For-EachObject
$threadSafeDictionary = [System.Collections.Concurrent.ConcurrentDictionary[string, object]]::new() Measure-Command -Expression { & { Get-Process | ForEach-Object -Parallel -ThrottleLimit 3 -UseNewRunspace { $dict = $using:threadSafeDictionary $dict.TryAdd($_.ProcessName, $_) } } } $threadSafeDictionary.Values | Format-Table -AutoSize
Creating new windows, keeps reproducing the error
code --version code version: 1.59.1, 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa, x64
PSVersion GitCommitId OS PSEdition --------- ----------- -- --------- 7.1.4 7.1.4 Microsoft Windows 10.0.19043 Core code-insiders --version 1.62.0-insider, 284e0db6c4cac1e557a43cd6691babdaafc2e1a9, x64
Tracking in SeeminglyScience/EditorServicesCommandSuite#69 (ConvertTo-SplatExpression isn't provided by the extension)
Issue:
Splat is outputting this
Expected Behaviour
-parallel
should splat as abool
To reproduce
Use
ConvertTo-SplatExpression
on theFor-EachObject
Behavior
Creating new windows, keeps reproducing the error
Environment
test 1
test 2