Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

UX Friction: Drop legacy "v1" enforcement by supporting .pss, .pwsh, or extension-less scripts (Related to #26584)

未关闭
#28,052 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, powershell
领域
cli

调研方向

Start at the pwsh -File entry point and review the extension-less script handling discussed in related issue #26584. Define acceptance criteria for .pss, .pwsh, and extension-less files while preserving existing .ps1 support; the issue does not name specific files or tests.

由索引模型根据 Issue 内容生成。

描述

Issue-Enhancement Needs-Triage
Summary of the new feature / enhancement
Summary of the new feature/enhancement

The enforcement of the .ps1 file extension feels increasingly like an archaic holdover from the 2006 Windows-only PowerShell 1.0 architecture. Forcinig a hardcoded "Version 1" into the extension creates a persistent UX friction point for modern cross-platform automation pipelines.

Modern shells (such as Bash and Python) focus on script parsing logic rather than strict extension requirements. We need a cleaner alternative to .ps1 that adapts to modern cross-platform development workflows.

This is fundamentally related to the issue discussed in #26584 regarding extension-less script handling.

Proposed technical behavior

Allow the pwsh engine to execute files using modernized or non-enforced file parameters. I propose the engine should actively support the following three avenues:

  1. Option A: Compact Script Extension (.pss)
    Support .pss ([P]ower[S]hell [S]cript) to offer a clean 3-character alternative that avoids system conflicts with Adobe PostScript (.ps).

  2. Option B: Modernized Extension (.pwsh)
    Natively recognize .pwsh to align with the name of the open-source cross-platform engine binary. It drops the legacy version "1" while clearly differentiating Core from Windows PowerShell.

  3. Option C: Pure Extension-less Execution (No Extension)
    Allow pwsh -File <filename> to parse and execute valid PowerShell script data regardless of the file suffix (or complete lack of one). This natively fixes environments like Linux Git hooks, which explicitly require extension-less scripts (see context in #26584).

Proposed solutions for compatibility
  • Parser Agnosticism: If a text file is explicitly fed to the -File parameter, the engine should parse the text block rather than strictly demanding a .ps1 regex match.
  • Side-by-Side Coexistence: Maintain full fallback support for .ps1 to prevent breaking millions of existing production enterprise scripts, while allowing developers to opt-into the cleaner naming styles.
Evaluation of alternatives

The alternative is forcing developers to write awkward wrapper scripts or manage complex execution blocks just to run an extension-less automation task. Adopting a flexible model simplifies the user experience and updates PowerShell's identity to better match the standards of the open-source community.

Proposed technical implementation details (optional)

No response

主要语言
C#
星标
55.5k
派生
8.5k
平均合并
1 天 17 小时
30 天内合并 PR
97

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PowerShell 的其他 Issue

查看 PowerShell/PowerShell 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。