一键导入
powershell-safe-chain
Chain PowerShell commands safely without &&. Use try/catch, ErrorAction, and proper sequencing for reliable Windows execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Chain PowerShell commands safely without &&. Use try/catch, ErrorAction, and proper sequencing for reliable Windows execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | powershell-safe-chain |
| description | Chain PowerShell commands safely without &&. Use try/catch, ErrorAction, and proper sequencing for reliable Windows execution. |
Chain commands reliably on Windows PowerShell. No && anti-patterns.
PowerShell differs from bash:
&& does NOT work for command chaining\ vs /)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
}
# 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
$params = @{
Path = $filePath
Encoding = 'UTF8'
Force = $true
}
Set-Content @params
| 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 |
[SecureString] for passwords$env:VARUse when:
Chain safely. Fail explicitly.
Fix OpenClaw connectivity to foreign apps for users in China without resetting existing tasks or tokens. Use when WhatsApp/Telegram/Discord linking fails with WebSocket timeout or handshake errors (for example status=408 Request Time-out, Opening handshake has timed out), when direct outbound access is blocked but VPN/proxy is available, or when OpenClaw can reach local dashboard but channels remain "Not linked".
Coordinate between local skills and discovered ClawHub patterns. Integrates phoenix-loop, agent-audit-trail, HEARTBEAT, and autonomy skills with external best practices.
Publish skills to ClawHub via web dashboard only. No CLI login, no device flow. Reuse existing browser session.
When blocked, report exact blocker + attempts made + minimum user input needed. Enable fast unblock without back-and-forth.
Verify evidence URLs are real and accessible. Check that artifact links resolve to actual content, not placeholders.
Diagnose and fix gateway token mismatches causing 401 errors. Align tokens across config, service, and CLI surfaces.