Agent skill · Documentation

powershell-safe-invocation

Use when writing or running PowerShell on Windows, especially native programs, quoted paths, escaping, pwsh, Start-Process, file operations, or shell troubleshooting.

Misaka-Mikoto-Techgithub.com/Misaka-Mikoto-TechGitHub ↗
codexMIT
Install
npx skills add Misaka-Mikoto-Tech/agent-skills --skill powershell-safe-invocation --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Path: skills/powershell-safe-invocation/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 213
Language: PowerShell

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# PowerShell Safe Invocation ## Shell Use PowerShell 7 through `pwsh.exe` unless Windows PowerShell 5.1 is explicitly required. When the active shell is uncertain, verify: ```powershell $PSVersionTable.PSVersion $PSNativeCommandArgumentPassing ``` Do not assume installing PowerShell 7 makes `powershell.exe` use PowerShell 7: - `pwsh.exe` = PowerShell 7 - `powershell.exe` = Windows PowerShell 5.1 ## Native Programs Never construct one large command string when arguments can be passed separately. Use: ```powershell $exe = 'C:\Path With Spaces\tool.exe' $argList = @( '--input' 'C:\Data Folder\input.json' '--flag' ) & $exe @argList $exitCode = $LASTEXITCODE if ($exitCode -ne 0) { throw "$exe failed with exit code $exitCode" } ``` Rules: - Treat every native argument as one array item. - Invoke executable paths stored in variables with `&`. - Capture `$LASTEXITCODE` immediately. - Avoid using `$args` as your own argument array name; it is a PowerShell automatic variable. Use names like `$argList` or `$nativeArgs`. - Do not use `Invoke-Expression`. - Do not add a `cmd.exe /c` layer merely to launch an executable. - Do not use Bash-style `\"` escaping in PowerShell. ## Cmdlets Use hashtab

What's inside
Steps it walks through
  1. Shell
  2. Native Programs
  3. Cmdlets
  4. Complex Commands
  5. Strings And Multiline Code
  6. Start-Process
  7. File Operations
  8. Version And Module Differences
  9. Decision Order
Ships with 1 file
  • reference.md
More from agent-skills
All skills →
About this skill
What does the powershell-safe-invocation skill do?

Use when writing or running PowerShell on Windows, especially native programs, quoted paths, escaping, pwsh, Start-Process, file operations, or shell troubleshooting.

How do I install it?

Run `npx skills add Misaka-Mikoto-Tech/agent-skills --skill powershell-safe-invocation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From Misaka-Mikoto-Tech/agent-skills, a repository with 213 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going