Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add -LiteralPath parameter to Start-ThreadJob for cross-platform path handling

オープン
#56 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
powershell
領域
cli

調査の方向性

Start with src/code/Microsoft.PowerShell.ThreadJob.cs, especially the GetScriptBlockFromFile method linked in the issue, and trace how -FilePath parameter sets are declared. Compare the parameter sets and aliases with Start-Job, then inspect or run the existing Start-ThreadJob tests for file paths. Done means -LiteralPath, -PSPath, and -LP accept wildcard characters literally and cannot be combined with -FilePath.

索引モデルが issue の本文から書いたものです。

説明

enhancement
Summary of the new feature / enhancement

Summary

Start-ThreadJob should support -LiteralPath parameter (with -PSPath and -LP aliases) to match Start-Job's functionality and handle cross-platform file paths that may contain wildcard characters.

Problem

PowerShell is now cross-platform, and characters traditionally used as wildcards (*, ?, [, ]) may be present in filenames on non-Windows systems (e.g., Linux, macOS). Currently, Start-ThreadJob only has a -FilePath parameter, which may cause issues when:

  1. A legitimate filename contains wildcard characters on Unix-like systems
  2. Users need to ensure paths are interpreted literally without pattern matching
  3. Users want API consistency between Start-Job and Start-ThreadJob

Current Behavior

Start-ThreadJob only supports:

Start-ThreadJob -FilePath "path/to/script.ps1"

The -FilePath parameter rejects paths with wildcard characters (see GetScriptBlockFromFile method):

if (WildcardPattern.ContainsWildcardCharacters(filePath))
{
    throw new ArgumentException("FilePath cannot contain wildcards.");
}
Proposed technical implementation details (optional)

Proposed Solution

Add a -LiteralPath parameter to Start-ThreadJob with:

  • Aliases: -PSPath, -LP (matching Start-Job)
  • Behavior: Interprets paths literally without wildcard evaluation
  • Mutual exclusivity: -FilePath and -LiteralPath should be in different parameter sets

Example usage:

# For a file literally named "test[1].ps1" on Linux
Start-ThreadJob -LiteralPath "/home/user/scripts/test[1].ps1"

# With aliases
Start-ThreadJob -PSPath "/home/user/scripts/test[1].ps1"
Start-ThreadJob -LP "/home/user/scripts/test[1].ps1"
主要言語
PowerShell
スター
37
フォーク
22
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/ThreadJob のほかの issue

PowerShell/ThreadJob の issue をすべて見る

似ている issue

CLI の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。