-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Moved from PowerShell/PowerShellEditorServices#1610 from @ninmonkey (thanks for the report!)
Issue:
Splat is outputting this
$forEachObjectSplat = @{
Parallel = -Parallel
}
Get-Process | ForEach-Object @forEachObjectSplat {
Expected Behaviour
-parallel
should splat as a bool
To reproduce
Use ConvertTo-SplatExpression
on the 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
Behavior
Creating new windows, keeps reproducing the error
Environment
test 1
Addon | Version |
---|---|
ms-vscode.powershell-preview | 2021.10.3 |
TylerLeonhardt.vscode-inline-values-powershell | 0.0.5 |
TylerLeonhardt.vscode-pester-test-adapter | 0.0.23 |
code --version
code version: 1.59.1, 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa, x64
test 2
Addon | Version |
---|---|
justin-grote.powershell-extension-pack | 0.0.5 |
ms-vscode-remote.remote-ssh-edit | 0.65.8 |
ms-vscode.powershell-preview | 2021.9.2 |
nickdemayo.vscode-json-editor | 0.3.0 |
PowerQuery.vscode-powerquery | 0.1.23 |
rust-lang.rust | 0.7.8 |
TylerLeonhardt.vscode-inline-values-powershell | 0.0.5 |
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
Metadata
Metadata
Assignees
Labels
No labels