Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PowerShell wrapper breaks some common GNU command forms

Open
#23 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
powershell, rust

Research direction

Start by reproducing the cat -- -dash.txt, grep, and cp cases with the PowerShell wrapper source at commit fe33724, then compare its argument handling with the release artifact. Check whether the wrapper can preserve the -- filename case and identify which other GNU/POSIX forms are shell-syntax limitations; done should include a verified fix or explicit wrapper documentation.

Written by the indexing model from the issue text.

Description

C-bug P-backlog

With the PowerShell wrapper enabled, I still hit a few GNU command lines that behave in surprising ways.

The clearest one is a filename starting with -:

Set-Content -LiteralPath '-dash.txt' -Value 'dash file foo'
cat -- -dash.txt

Expected:

dash file foo

Actual:

cat.cmd: '-dash': The system cannot find the file specified.
cat: .txt: The system cannot find the file specified.

It looks like -dash.txt is getting split into -dash and .txt. The same shape also fails for me with:

grep foo -- -dash.txt
cp -- -dash.txt dash-copy.txt

This workaround does work:

cat -- .\-dash.txt
grep foo -- .\-dash.txt
cp -- .\-dash.txt dash-copy.txt

I also ran into a few common GNU/POSIX forms that do not survive the wrapper:

find . \( -name "*.txt" -o -name "*.log" \) -print
find . -name "*.txt" -exec grep foo {} \;
[ -f a.txt ]
cat space\ name.txt
ls \[ab\].txt

Some of these are clearly PowerShell-vs-POSIX-shell syntax issues, so I am not claiming they are all coreutils bugs. But they are common command lines from GNU docs / muscle memory, and they are exactly the kind of cases users will try when using this project.

It would be useful either to handle the cases that can be handled, or to document the boundary of the PowerShell wrapper more explicitly. The -- -dash.txt case in particular looks like an argument-passing bug rather than just a POSIX shell compatibility limitation.

Environment:

  • Windows 10.0.26200
  • PowerShell 7.5.5
  • Wrapper source tested from commit fe33724
  • Release artifact tested: coreutils-2026.5.29-x64.exe
  • SHA256: 23B019D0664F1F5AA2A0C503435F8B52D3C8EEA2AEC1C0609CE21FCE18667281
Dominant language
Rust
Stars
5.2k
Forks
107
Avg merge
2d 19h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/coreutils

All issues in microsoft/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.