Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Misaka-Mikoto-Tech/agent-skills --skill powershell-safe-invocationgit clone --depth 1 https://github.com/Misaka-Mikoto-Tech/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/misaka-mikoto-tech/agent-skills/powershell-safe-invocation)<a href="https://agentmods.dev/skills/misaka-mikoto-tech/agent-skills/powershell-safe-invocation"><img src="https://agentmods.dev/badge/skills/misaka-mikoto-tech/agent-skills/powershell-safe-invocation.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00040 | $0.01777 |
| Opus 5 | $0.00020 | $0.00889 |
| Sonnet 5 | $0.00008 | $0.00355 |
| Haiku 4.5 | $0.00004 | $0.00178 |
Grade A, and why
powershell-safe-invocation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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:
$PSVersionTable.PSVersion
$PSNativeCommandArgumentPassing
Do not assume installing PowerShell 7 makes powershell.exe use PowerShell 7:
pwsh.exe= PowerShell 7powershell.exe= Windows PowerShell 5.1
Native Programs
Never construct one large command string when arguments can be passed separately.
Use:
$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
$LASTEXITCODEimmediately. - Avoid using
$argsas your own argument array name; it is a PowerShell automatic variable. Use names like$argListor$nativeArgs. - Do not use
Invoke-Expression. - Do not add a
cmd.exe /clayer merely to launch an executable. - Do not use Bash-style
\"escaping in PowerShell.
Cmdlets
Use hashtable splatting for PowerShell cmdlets:
$params = @{
LiteralPath = 'C:\Data[1]\input.txt'
Destination = 'C:\Output'
Force = $true
ErrorAction = 'Stop'
}
Copy-Item @params
Use -LiteralPath for concrete paths when the cmdlet supports it. For cmdlets that expose only -Path, such as New-Item, use -Path; when unsure, check Get-Command <cmdlet> -Syntax.
Do not use $LASTEXITCODE to test a PowerShell cmdlet. Use terminating errors:
$ErrorActionPreference = 'Stop'
Wrap expressions passed as parameter values in parentheses or assign them first: use Select-Object -Index (100..120), not -Index 100..120.
Do not pipe directly from statement syntax such as foreach (...) { ... } | ...; assign the statement output first or use the pipeline cmdlet ForEach-Object.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 203 lines · 40 tokens per session scan A 7d376c76f0d9
powershell-safe-invocation is a skill published in the GitHub repository Misaka-Mikoto-Tech/agent-skills (254 stars, last pushed 3d ago), licensed MIT. It adds 40 tokens to every session and 1,777 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
codex-multi-profile
Windows Codex Desktop multi-account picker (Codex Accounts app) plus AuthSwap launchers (codex1, codex2, ...). Humans pick accounts in Show-CodexAccountApp.ps1. Agents use pool / stick / route / depleted. ShareLive keeps history in /.codex; only auth.json is per-profile. Launch MUST set env vars through a cmd wrapper.…
windows-dev-process-cleanup
A Windows troubleshooting guide for auditing and safely cleaning leftover development processes and UWP background tasks. UWP is Windows' platform for packaged apps.
clean-windows-c-drive
Provide a standalone Simplified Chinese Windows app and CLI workflows to assess C: drive health, clean a fixed allowlist of regenerable junk, find large user files, detect exact duplicates with SHA-256, and relocate or recycle explicitly approved ordinary user files without breaking Windows or installed applications.…
powershell-docs
PowerShell 7.6 + Windows PowerShell 5.1 — variables, arrays, hashtables, functions, classes, remoting, modules, DSC.
deobfuscating-malicious-powershell
Deobfuscates malicious PowerShell by decoding -EncodedCommand, reversing string and format obfuscation, resolving base64/gzip/IEX layers, and recovering the final payload and IOCs. Activates for requests to deobfuscate, decode, or analyze obfuscated PowerShell commands or scripts.
hunting-suspicious-powershell-execution
Hunts malicious PowerShell using script-block (EID 4104) and module logging: scoring encoded commands, download cradles, AMSI/logging bypass, and in-memory execution, then decoding payloads for triage. Activates for requests to hunt malicious PowerShell, analyze script-block logs, or detect encoded command abuse.