PowerShell Safe Chain
Chain PowerShell commands safely without &&. Use try/catch, ErrorAction, and proper sequencing for reliable Windows execution.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 237 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description (safe PowerShell chaining) align with the content: the SKILL.md contains patterns, examples, and checks that are relevant to writing and verifying PowerShell scripts. No unrelated binaries, credentials, or config paths are requested.
Instruction Scope
The runtime instructions are limited to coding patterns, try/catch, ErrorAction, splatting, and a few verification commands (Select-String against *.ps1). Those checks operate on PowerShell scripts (reasonable for this skill). The doc does not instruct reading unrelated system secrets or sending data externally.
Install Mechanism
No install spec and no code files — instruction-only. This minimizes disk writes and external downloads; low installation risk.
Credentials
No environment variables, credentials, or config paths are required. The doc merely advises how to reference env vars in PowerShell when appropriate (using $env:VAR) and to use SecureString for passwords — proportionate to the topic.
Persistence & Privilege
Skill is not marked always:true and does not request persistent presence or modify other skills/settings. It is user-invocable and may be invoked autonomously (platform default), which is expected for skills.
Scan Findings in Context
[NO_FINDINGS] expected: The static scanner found no matches; this is expected because the skill is instruction-only (SKILL.md) and contains no executable code files to scan.
Assessment
This skill is a set of PowerShell best-practice instructions and appears coherent and low-risk. Before using: review the SKILL.md examples and any commands you plan to run against your system (the verification commands search *.ps1 in the working directory), and avoid blindly executing scripts from untrusted sources. Note the skill has no homepage or known author — if you need higher assurance, prefer guidance from a vetted documentation source or a trusted PowerShell style guide.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
PowerShell Safe Chain
Chain commands reliably on Windows PowerShell. No && anti-patterns.
Problem
PowerShell differs from bash:
&&does NOT work for command chaining- Parameter parsing is case-insensitive but strict
- Errors continue by default (no fail-fast)
- Path separators vary (
\vs/)
Workflow
1. Safe Chaining Pattern
Wrong:
mkdir test && cd test && echo done
Right:
$ErrorActionPreference = 'Stop'
try {
New-Item -ItemType Directory -Path test -Force
Set-Location test
Write-Host 'done'
} catch {
Write-Error "Failed at step: $_"
exit 1
}
2. Conditional Chaining
# If-then pattern
if (Test-Path $file) {
Remove-Item $file
Write-Host "Deleted"
} else {
Write-Warning "File not found"
}
# Pipeline with error handling
Get-Process | Where-Object CPU -GT 100 | Stop-Process -WhatIf
3. Splatting for Complex Commands
$params = @{
Path = $filePath
Encoding = 'UTF8'
Force = $true
}
Set-Content @params
Executable Completion Criteria
| Criteria | Verification |
|---|---|
No && in scripts | Select-String '&&' *.ps1 returns nothing |
| ErrorAction set | Select-String 'ErrorAction' *.ps1 matches |
| try/catch present | `Select-String 'try |
| Paths use Join-Path | Select-String 'Join-Path' *.ps1 matches |
Privacy/Safety
- No hardcoded credentials
- Use
[SecureString]for passwords - Environment variables via
$env:VAR
Self-Use Trigger
Use when:
- Writing any PowerShell script
- Chaining 2+ commands
- Executing file operations
Chain safely. Fail explicitly.
Files
1 totalSelect a file
Select a file to preview.
Comments
Loading comments…
