GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Support splatting `-ArgumentList` with hashtable too · Issue #37 · PowerShell/ThreadJob Open DescriptionSummary of the new feature / enhancement
This means some example code must be like this: $JobsUsingArray = [array]( 1 .. 3 | ForEach-Object -Process { Start-ThreadJob -ScriptBlock { [OutputType([System.String])] Param( [Parameter(Mandatory,Position=0)][string]$SomeParameter ) Write-Output -InputObject $SomeParameter } -ArgumentList ('Hello {0}' -f $_) } ) Receive-Job -Job $JobsUsingArray -Wait which returns: I much prefer to splat using name of the input parameters, so splatting with hashtable. I'd like this to work too: $JobsUsingHashtable = [array]( 1 .. 3 | ForEach-Object -Process { Start-ThreadJob -ScriptBlock { [OutputType([System.String])] Param( [Parameter(Mandatory)][string]$SomeParameter ) Write-Output -InputObject $SomeParameter } -ArgumentList @{ 'SomeParameter' = [string] 'Hello {0}' -f $_ } } ) Receive-Job -Job $JobsUsingHashtable -Wait which returns Proposed technical implementation details (optional)No response ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |