Support splatting `-ArgumentList` with hashtable too
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- powershell
- 領域
- backend
調査の方向性
Start at the Start-ThreadJob argument handling and compare how -ArgumentList processes arrays with the hashtable example in this issue. The request is to pass named parameters through to the job script block; check the project’s existing tests for -ArgumentList and add coverage for the shown hashtable case. Done when the job receives SomeParameter as the string Hello 1, Hello 2, and Hello 3.
索引モデルが issue の本文から書いたものです。
説明
Summary of the new feature / enhancement
Start-ThreadJob (and Start-Job for reference) currently only supports splatting -ArgumentList with array:
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:
Hello 1
Hello 2
Hello 3
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
System.Collections.Hashtable
System.Collections.Hashtable
System.Collections.Hashtable
Proposed technical implementation details (optional)
No response
- 主要言語
- PowerShell
- スター
- 37
- フォーク
- 22
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/ThreadJob のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
PowerShell/ThreadJob#59 · リアクション 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
PowerShell/ThreadJob#56 · リアクション 1 件 ·
-
Set alias for ThreadJob command(s)対応中かも @kilasuit が 80 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
PowerShell/ThreadJob#45 · コメント 1 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 48/100
PowerShell/ThreadJob#44 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
PowerShell/ThreadJob#43 ·
PowerShell/ThreadJob の issue をすべて見る
似ている issue
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
bug priority: P3 ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
shep-pm/shep-kelpie#1332 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aristocratos/btop#1945 ·
メンテナーはふだん 2 日以内に返信