Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#56 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
56/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
powershell
Bereich
cli

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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"
Vorherrschende Sprache
PowerShell
Sterne
37
Forks
22
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/ThreadJob

Alle Issues in PowerShell/ThreadJob

Ähnliche Issues

Weitere Issues zu CLI

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.