{
  "schemaVersion": "1.0",
  "item": {
    "slug": "powershell-reliable",
    "name": "PowerShell Reliable Execution",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Dalomeve/powershell-reliable",
    "canonicalUrl": "https://clawhub.ai/Dalomeve/powershell-reliable",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/powershell-reliable",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=powershell-reliable",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "references/privacy-checklist.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/powershell-reliable"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/powershell-reliable",
    "agentPageUrl": "https://openagent3.xyz/skills/powershell-reliable/agent",
    "manifestUrl": "https://openagent3.xyz/skills/powershell-reliable/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/powershell-reliable/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "PowerShell Reliable Execution",
        "body": "Execute commands reliably on Windows PowerShell. Avoid common pitfalls like && chaining, parameter swallowing, and session interruptions."
      },
      {
        "title": "Problem Statement",
        "body": "Windows PowerShell differs from bash in critical ways:\n\nIssueBashPowerShellSolutionCommand chainingcmd1 && cmd2cmd1 -ErrorAction Stop; if ($?) { cmd2 }Use semicolons + error handlingParameter parsing-arg value-Argument value (case-insensitive)Use full parameter namesPath separators/\\ (or / in some cmdlets)Use Join-PathOutput redirection> >>> >> (encoding issues)Use Out-File -Encoding UTF8Environment vars$VAR$env:VARUse $env: prefix"
      },
      {
        "title": "1. Safe Command Chaining",
        "body": "Wrong:\n\nmkdir test && cd test && echo done\n\nRight:\n\n$ErrorActionPreference = 'Stop'\ntry {\n    New-Item -ItemType Directory -Path test -Force\n    Set-Location test\n    Write-Host 'done'\n} catch {\n    Write-Error \"Failed: $_\"\n    exit 1\n}"
      },
      {
        "title": "2. Parameter Safety",
        "body": "Wrong:\n\ngit commit -m \"message\"\n\nRight:\n\ngit commit -Message \"message\"\n# Or use splatting:\n$params = @{ Message = \"message\" }\ngit commit @params"
      },
      {
        "title": "3. Path Handling",
        "body": "Wrong:\n\n$path = \"C:/Users/name/file.txt\"\n\nRight:\n\n$path = Join-Path $env:USERPROFILE \"file.txt\"\n# Or use literal paths:\n$path = 'C:\\Users\\name\\file.txt'"
      },
      {
        "title": "4. Output Encoding",
        "body": "Wrong:\n\necho \"text\" > file.txt\n\nRight:\n\n\"text\" | Out-File -FilePath file.txt -Encoding UTF8"
      },
      {
        "title": "5. Session Continuity",
        "body": "For long-running commands:\n\n# Start background job\n$job = Start-Job -ScriptBlock {\n    param($arg)\n    # Long operation\n} -ArgumentList $arg\n\n# Wait with timeout\nWait-Job $job -Timeout 300\n\n# Get results\nif ($job.State -eq 'Completed') {\n    Receive-Job $job\n} else {\n    Stop-Job $job\n    Write-Warning \"Job timed out\"\n}"
      },
      {
        "title": "Retry Pattern",
        "body": "function Invoke-Retry {\n    param(\n        [scriptblock]$Command,\n        [int]$MaxAttempts = 3,\n        [int]$DelaySeconds = 2\n    )\n    \n    $attempt = 0\n    while ($attempt -lt $MaxAttempts) {\n        try {\n            $attempt++\n            return & $Command\n        } catch {\n            if ($attempt -eq $MaxAttempts) { throw }\n            Start-Sleep -Seconds $DelaySeconds\n        }\n    }\n}\n\n# Usage\nInvoke-Retry -Command { Invoke-WebRequest -Uri $url } -MaxAttempts 3"
      },
      {
        "title": "Interruption Recovery",
        "body": "# Checkpoint pattern\n$checkpointFile = \".checkpoint.json\"\n\nif (Test-Path $checkpointFile) {\n    $state = Get-Content $checkpointFile | ConvertFrom-Json\n    Write-Host \"Resuming from step $($state.step)\"\n} else {\n    $state = @{ step = 0 }\n}\n\nswitch ($state.step) {\n    0 { \n        # Step 1\n        $state.step = 1\n        $state | ConvertTo-Json | Out-File $checkpointFile\n    }\n    1 {\n        # Step 2\n        Remove-Item $checkpointFile\n    }\n}"
      },
      {
        "title": "Privacy Security",
        "body": "All execution is local:\n\nNO command logging to external services\nNO credential capture in scripts\nNO automatic upload of execution results\nSensitive data handled via [SecureString]\nCheckpoint files stored in working directory only\n\nSensitive Data Filter:\nBefore writing any checkpoint or log:\n\nExclude Password, Token, Secret, ApiKey\nUse [SecureString] for credentials\nNever echo sensitive variables"
      },
      {
        "title": "Executable Completion Criteria",
        "body": "A PowerShell command execution is reliable if and only if:\n\nCriteriaVerificationNo && chainingSelect-String '&&' script.ps1 returns nothingError handling present`Select-String 'tryPaths use Join-Path`Select-String 'Join-PathOutput encoding specifiedSelect-String 'Out-File.*Encoding' script.ps1 matchesCheckpoint for long opsCheckpoint file pattern present for ops > 60sNo hardcoded secrets`Select-String 'password"
      },
      {
        "title": "Common Cmdlet Mappings",
        "body": "TaskBashPowerShellList filesls -laGet-ChildItem -ForceChange dircd /pathSet-Location C:\\pathCreate dirmkdir xNew-Item -ItemType Directory xCopy filecp a bCopy-Item a bMove filemv a bMove-Item a bDeleterm xRemove-Item xView filecat xGet-Content xEdit filevim xnotepad xFind textgrep xSelect-String xPipe|| (same)Redirect>> (use Out-File)"
      },
      {
        "title": "Splatting Template",
        "body": "$params = @{\n    Path = $filePath\n    Encoding = 'UTF8'\n    Force = $true\n}\nSet-Content @params"
      },
      {
        "title": "References",
        "body": "references/privacy-checklist.md - Privacy security checklist\nMicrosoft Docs: PowerShell Best Practices\n\nExecute reliably. Recover gracefully."
      }
    ],
    "body": "PowerShell Reliable Execution\n\nExecute commands reliably on Windows PowerShell. Avoid common pitfalls like && chaining, parameter swallowing, and session interruptions.\n\nProblem Statement\n\nWindows PowerShell differs from bash in critical ways:\n\nIssue\tBash\tPowerShell\tSolution\nCommand chaining\tcmd1 && cmd2\tcmd1 -ErrorAction Stop; if ($?) { cmd2 }\tUse semicolons + error handling\nParameter parsing\t-arg value\t-Argument value (case-insensitive)\tUse full parameter names\nPath separators\t/\t\\ (or / in some cmdlets)\tUse Join-Path\nOutput redirection\t> >>\t> >> (encoding issues)\tUse Out-File -Encoding UTF8\nEnvironment vars\t$VAR\t$env:VAR\tUse $env: prefix\nCore Patterns\n1. Safe Command Chaining\n\nWrong:\n\nmkdir test && cd test && echo done\n\n\nRight:\n\n$ErrorActionPreference = 'Stop'\ntry {\n    New-Item -ItemType Directory -Path test -Force\n    Set-Location test\n    Write-Host 'done'\n} catch {\n    Write-Error \"Failed: $_\"\n    exit 1\n}\n\n2. Parameter Safety\n\nWrong:\n\ngit commit -m \"message\"\n\n\nRight:\n\ngit commit -Message \"message\"\n# Or use splatting:\n$params = @{ Message = \"message\" }\ngit commit @params\n\n3. Path Handling\n\nWrong:\n\n$path = \"C:/Users/name/file.txt\"\n\n\nRight:\n\n$path = Join-Path $env:USERPROFILE \"file.txt\"\n# Or use literal paths:\n$path = 'C:\\Users\\name\\file.txt'\n\n4. Output Encoding\n\nWrong:\n\necho \"text\" > file.txt\n\n\nRight:\n\n\"text\" | Out-File -FilePath file.txt -Encoding UTF8\n\n5. Session Continuity\n\nFor long-running commands:\n\n# Start background job\n$job = Start-Job -ScriptBlock {\n    param($arg)\n    # Long operation\n} -ArgumentList $arg\n\n# Wait with timeout\nWait-Job $job -Timeout 300\n\n# Get results\nif ($job.State -eq 'Completed') {\n    Receive-Job $job\n} else {\n    Stop-Job $job\n    Write-Warning \"Job timed out\"\n}\n\nError Recovery\nRetry Pattern\nfunction Invoke-Retry {\n    param(\n        [scriptblock]$Command,\n        [int]$MaxAttempts = 3,\n        [int]$DelaySeconds = 2\n    )\n    \n    $attempt = 0\n    while ($attempt -lt $MaxAttempts) {\n        try {\n            $attempt++\n            return & $Command\n        } catch {\n            if ($attempt -eq $MaxAttempts) { throw }\n            Start-Sleep -Seconds $DelaySeconds\n        }\n    }\n}\n\n# Usage\nInvoke-Retry -Command { Invoke-WebRequest -Uri $url } -MaxAttempts 3\n\nInterruption Recovery\n# Checkpoint pattern\n$checkpointFile = \".checkpoint.json\"\n\nif (Test-Path $checkpointFile) {\n    $state = Get-Content $checkpointFile | ConvertFrom-Json\n    Write-Host \"Resuming from step $($state.step)\"\n} else {\n    $state = @{ step = 0 }\n}\n\nswitch ($state.step) {\n    0 { \n        # Step 1\n        $state.step = 1\n        $state | ConvertTo-Json | Out-File $checkpointFile\n    }\n    1 {\n        # Step 2\n        Remove-Item $checkpointFile\n    }\n}\n\nPrivacy Security\n\nAll execution is local:\n\nNO command logging to external services\nNO credential capture in scripts\nNO automatic upload of execution results\nSensitive data handled via [SecureString]\nCheckpoint files stored in working directory only\n\nSensitive Data Filter: Before writing any checkpoint or log:\n\nExclude Password, Token, Secret, ApiKey\nUse [SecureString] for credentials\nNever echo sensitive variables\nExecutable Completion Criteria\n\nA PowerShell command execution is reliable if and only if:\n\nCriteria\tVerification\nNo && chaining\tSelect-String '&&' script.ps1 returns nothing\nError handling present\t`Select-String 'try\nPaths use Join-Path\t`Select-String 'Join-Path\nOutput encoding specified\tSelect-String 'Out-File.*Encoding' script.ps1 matches\nCheckpoint for long ops\tCheckpoint file pattern present for ops > 60s\nNo hardcoded secrets\t`Select-String 'password\nQuick Reference\nCommon Cmdlet Mappings\nTask\tBash\tPowerShell\nList files\tls -la\tGet-ChildItem -Force\nChange dir\tcd /path\tSet-Location C:\\path\nCreate dir\tmkdir x\tNew-Item -ItemType Directory x\nCopy file\tcp a b\tCopy-Item a b\nMove file\tmv a b\tMove-Item a b\nDelete\trm x\tRemove-Item x\nView file\tcat x\tGet-Content x\nEdit file\tvim x\tnotepad x\nFind text\tgrep x\tSelect-String x\nPipe\t|\t| (same)\nRedirect\t>\t> (use Out-File)\nSplatting Template\n$params = @{\n    Path = $filePath\n    Encoding = 'UTF8'\n    Force = $true\n}\nSet-Content @params\n\nReferences\nreferences/privacy-checklist.md - Privacy security checklist\nMicrosoft Docs: PowerShell Best Practices\n\nExecute reliably. Recover gracefully."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Dalomeve/powershell-reliable",
    "publisherUrl": "https://clawhub.ai/Dalomeve/powershell-reliable",
    "owner": "Dalomeve",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/powershell-reliable",
    "downloadUrl": "https://openagent3.xyz/downloads/powershell-reliable",
    "agentUrl": "https://openagent3.xyz/skills/powershell-reliable/agent",
    "manifestUrl": "https://openagent3.xyz/skills/powershell-reliable/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/powershell-reliable/agent.md"
  }
}