powershell-patterns SKILL.md skillA

This file is byte-identical to the first copy the registry indexed. Same content hash, so the same checks give both the same grade.

powershell-patterns from pablodiazjorge/prompt-forge is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add pablodiazjorge/prompt-forge/powershell-patterns@v2.1.0

Pins v2.1.0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
pablodiazjorge/prompt-forge
Path
template/.claude/skills/powershell-patterns/SKILL.md
Versions recorded
3
Latest version
v2.1.0, committed Oct 12, 2026
First version recorded
Oct 12, 2026
Size
7,482 bytes
Repository stars
2
License
MIT

Pitfalls and safe patterns for running commands and writing scripts in Windows PowerShell 5.1 and PowerShell 7.x. Use when running terminal commands on Windows, writing or debugging .ps1 scripts, chaining commands, checking the exit code of a native executable, writing files that contain $ or template syntax, handling file encodings, or switching toolchain versions.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# PowerShell Patterns

`powershell.exe` is **Windows PowerShell 5.1**: preinstalled, and what an agent
terminal usually gets. `pwsh` is **PowerShell 7.x**, a separate install. Check
`$PSVersionTable.PSVersion` before using modern syntax.

## 5.1 versus 7.x

| Feature | Windows PowerShell 5.1 | PowerShell 7.x |
|---|---|---|
| `&&` and `\|\|` | Parser error | 7.0+ |
| Ternary `a ? b : c`, `??`, `??=` | Not available: use `if`/`else` and `$null -eq $x` | 7.0+ |
| Null-conditional `?.` | Not available | 7.1+, written `${x}?.Prop` because `?` is legal in variable names |
| `ConvertFrom-Json -AsHashtable` | Not available (returns `PSCustomObject`) | 6.0+ |
| `curl`, `wget` | Aliases for `Invoke-WebRequest`: call `curl.exe` | Real executables |

Sequencing on either edition:

```powershell
cmd1; cmd2                # always runs cmd2
cmd1; if ($?) { cmd2 }    # runs cmd2 only if cmd1 succeeded
```

## Native executables

- Test `$LASTEXITCODE` after a build, test runner, linter, or `git`:
  `dotnet build; if ($LASTEXITCODE -ne 0) { throw "build failed" }`.
  Do not infer success from the output.
- **5.1:** redirecting a native command's stderr (`2>&1`, `2>$null`) turns each
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add pablodiazjorge/prompt-forge/powershell-patterns@sha256:7ec3a3531e7b7822

The line at the top of this page pins the label v2.1.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_qaosr4sk2akopd7k.svg)](https://markdownregistry.com/a/art_qaosr4sk2akopd7k)

1 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 3 versions of this file, all committed on Oct 12, 2026.

versioncommittedcommitsizeaudit
v2.1.0 latest2026-10-12 f0011ba 7,482 BA view · diff
v2.0.02026-10-12 f949b5b 7,482 BA view · diff
v2.0.02026-10-12 5d5a3e1 7,930 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (7482 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

pablodiazjorge/prompt-forge · 2 stars · license MIT · pushed 2026-10-12 · branch master

API

GET https://markdownregistry.com/api/v1/artifacts/art_qaosr4sk2akopd7k
GET https://markdownregistry.com/api/v1/resolve?ref=pablodiazjorge/prompt-forge/powershell-patterns
GET https://markdownregistry.com/api/v1/blob/7ec3a3531e7b782215cd028d471798a20c1f7b88aeaf257d1a504d3fc955af46

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from pablodiazjorge/prompt-forge

AGENTS.md AGENTS.md file
pablodiazjorge/prompt-forge · AGENTS.md
git:20261012.e45bca6 · audit A · 2 stars
CLAUDE.md CLAUDE.md file
pablodiazjorge/prompt-forge · CLAUDE.md
git:20261012.e45bca6 · audit B · 2 stars
curate-lessons SKILL.md skill
pablodiazjorge/prompt-forge · template/.agents/skills/curate-lessons/SKILL.md · Reviews every lesson in knowledge/lessons/, merges duplicates, rejects unsafe or trivial ones, promotes lessons seen by…
v2.1.0 · audit B · 2 stars
git-workflow SKILL.md skill
pablodiazjorge/prompt-forge · template/.agents/skills/git-workflow/SKILL.md · Non-interactive git usage and commit conventions for AI coding agents. Use when staging changes, committing, writing…
v2.1.0 · audit A · 2 stars
powershell-patterns SKILL.md skill
pablodiazjorge/prompt-forge · template/.agents/skills/powershell-patterns/SKILL.md · Pitfalls and safe patterns for running commands and writing scripts in Windows PowerShell 5.1 and PowerShell 7.x. Use…
v2.1.0 · audit A · 2 stars
record-lesson SKILL.md skill
pablodiazjorge/prompt-forge · template/.agents/skills/record-lesson/SKILL.md · Records a non-obvious failure, workaround, or project quirk as a lesson in knowledge/lessons/ so that teammates' agents…
v2.1.0 · audit A · 2 stars
curate-lessons SKILL.md skill
pablodiazjorge/prompt-forge · template/.claude/skills/curate-lessons/SKILL.md · Reviews every lesson in knowledge/lessons/, merges duplicates, rejects unsafe or trivial ones, promotes lessons seen by…
v2.1.0 · audit B · 2 stars
git-workflow SKILL.md skill
pablodiazjorge/prompt-forge · template/.claude/skills/git-workflow/SKILL.md · Non-interactive git usage and commit conventions for AI coding agents. Use when staging changes, committing, writing…
v2.1.0 · audit A · 2 stars
record-lesson SKILL.md skill
pablodiazjorge/prompt-forge · template/.claude/skills/record-lesson/SKILL.md · Records a non-obvious failure, workaround, or project quirk as a lesson in knowledge/lessons/ so that teammates' agents…
v2.1.0 · audit A · 2 stars
AGENTS.md@template AGENTS.md file
pablodiazjorge/prompt-forge · template/AGENTS.md
git:20261012.9adcef4 · audit A · 2 stars
CLAUDE.md@template CLAUDE.md file
pablodiazjorge/prompt-forge · template/CLAUDE.md
git:20261012.5d5a3e1 · audit B · 2 stars

Every file in pablodiazjorge/prompt-forge

Other files named powershell-patterns

powershell-patterns SKILL.md skill
pablodiazjorge/prompt-forge · template/.agents/skills/powershell-patterns/SKILL.md · Pitfalls and safe patterns for running commands and writing scripts in Windows PowerShell 5.1 and PowerShell 7.x. Use…
v2.1.0 · audit A · 2 stars

Browse by kind, by grade A, or by owner.