Powershell patterns
Skill pablodiazjorge/prompt-forge/.github/skills/powershell-patterns
Drop-in toolkit that gives AI coding agents persistent memory across sessions. Agent Skills, cross-session learning loop, and knowledge persistence. Zero dependencies, no backend.
npx -y skills add pablodiazjorge/prompt-forge --skill powershell-patternsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
PowerShell 5.1 patterns, pitfalls, and best practices for Windows development. Use when running terminal commands, writing PowerShell scripts, working with Node.js/npm on Windows, or encountering PowerShell errors. Covers nvm-windows, Angular template escaping, execution policy, and cmdlet selection.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.7 KB, as published. Nobody here has run it
PowerShell Patterns for Development
Critical Pitfalls
Templates with {{ }} — NEVER use Set-Content or heredocs
PowerShell interprets {{ }} as variable interpolation. Use the agent's create_file
tool for any file containing {{ }}, ${{}}, or Angular syntax.
# ❌ NEVER:
Set-Content file.html @"<div>{{ title }}</div>"@
# ✅ Always: agent create_file tool
# Editing existing files: replace_string_in_file
# Commands WITHOUT {{ }}: Set-Content with single quotes works fine
nvm-windows
nvm install X.Y.Zdoes NOT auto-activate →nvm use X.Y.Zis mandatorynvm listshows installed versions,*= active- Global packages (
@angular/cli) are NOT migrated between versions - Requires Admin shell — run PowerShell as Administrator
@angular/cli@22→ Node^22.22.3 || ^24.15.0 || >=26.0.0
Chaining — NEVER &&
&& is not valid in PowerShell 5.1:
npm install; npm run build # OK
npm install # Better: separate commands
npm run build
Execution Policy
Windows 11/10 default to Restricted — .ps1 scripts won't execute.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned # Requires admin
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser # Without admin
Best Practices
- Native cmdlets not aliases:
Get-ChildItemnotls,Select-Stringnotfindstr - Quote paths:
"C:\Path With Spaces\file.txt" Select-Object -First Nto limit output2>$nullto suppress stderrTest-Pathbefore reading/writing- NEVER
Start-Sleep— the agent is notified when async commands finish Remove-Item -Forceto delete;Push-Location/Pop-Locationto navigate
File Operations Decision Table
| Task | Tool |
|---|---|
Create file with {{ }} | Agent create_file |
| Edit existing file | replace_string_in_file |
| Multiple simultaneous edits | multi_replace_string_in_file |
| Simple script without templates | Set-Content with single quotes |
| Overwrite existing file | Remove-Item -Force → create_file |