windows-shell-reliability
FeaturedReliable command execution on Windows: paths, encoding, and common binary pitfalls.
AI & Automation 39,350 stars
6386 forks Updated today MIT
Install
Quality Score: 99/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Windows Shell Reliability Patterns
> Best practices for running commands on Windows via PowerShell and CMD.
## When to Use
Use this skill when developing or debugging scripts and automation that run on Windows systems, especially when involving file paths, character encoding, or standard CLI tools.
---
## 1. Encoding & Redirection
### CRITICAL: Redirection Differences Across PowerShell Versions
Older Windows PowerShell releases can rewrite native-command output in ways that break
later processing. PowerShell 7.4+ preserves the byte stream when redirecting stdout,
so only apply the UTF-8 conversion workaround when you are dealing with older shell
behavior or a log file that is already unreadable.
| Problem | Symptom | Solution |
|---------|---------|----------|
| `dotnet > log.txt` | `view_file` fails in older Windows PowerShell | `Get-Content log.txt | Set-Content -Encoding utf8 log_utf8.txt` |
| `npm run > log.txt` | Need a UTF-8 text log with errors included | `npm run ... 2>&1 | Out-File -Encoding UTF8 log.txt` |
**Rule:** Prefer native redirection as-is on PowerShell 7.4+, and use explicit UTF-8
conversion only when older Windows PowerShell redirection produces an unreadable log.
---
## 2. Handling Paths & Spaces
### CRITICAL: Quoting
Windows paths often contain spaces.
| ❌ Wrong | ✅ Correct |
|----------|-----------|
| `dotnet build src/my project/file.fsproj` | `dotnet build "src/my project/file.fsproj"` |
| `& C:\Path With Spaces\bin.exe` | `& "C:\Path Wit...
Details
- Author
- sickn33
- Repository
- sickn33/antigravity-awesome-skills
- Created
- 4 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Listed
windows-shell-reliability
Reliable command execution on Windows: paths, encoding, and common binary pitfalls.
4 Updated 2 weeks ago
arlenagreer Code & Development Listed
windows-shell-reliability
Reliable command execution on Windows: paths, encoding, and common binary pitfalls.
0 Updated today
tapanshah Code & Development Listed
windows-shell-reliability
Reliable command execution on Windows: paths, encoding, and common binary pitfalls.
0 Updated today
deco31416 Code & Development Listed
windows-shell-reliability
Reliable command execution on Windows: paths, encoding, and common binary pitfalls.
0 Updated 2 months ago
Sapeksh2001 AI & Automation Solid
powershell-windows
PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.
27,705 Updated today
davila7