← All skills
Tencent SkillHub · Developer Tools

PowerShell

Avoid common PowerShell mistakes — output behavior, array traps, and comparison operator gotchas.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Avoid common PowerShell mistakes — output behavior, array traps, and comparison operator gotchas.

⬇ 0 downloads ★ 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

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.

Upgrade existing

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.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 8 sections Open source page

Output Behavior

Everything not captured goes to output — even without return or Write-Output return doesn't stop output — previous uncaptured expressions still output Write-Host bypasses pipeline — use for display only, not data Assign to $null to suppress — $null = SomeFunction [void] cast also suppresses — [void](SomeFunction)

Array Gotchas

Single item result is scalar, not array — @(Get-Item .) forces array Empty result is $null, not empty array — check with if ($result) carefully Array unrolling in pipeline — @(1,2,3) | ForEach sends items one by one += on array creates new array — slow in loops, use [System.Collections.ArrayList] , is array operator — ,$item wraps single item in array

Comparison Operators

-eq, -ne, -gt, -lt — not ==, !=, >, < -like with wildcards, -match with regex — both return bool -contains for array membership — $arr -contains $item, not $item -in $arr (though -in works too) Case-insensitive by default — -ceq, -cmatch for case-sensitive $null on left side — $null -eq $var prevents array comparison issues

String Handling

Double quotes interpolate — "Hello $name" expands variable Single quotes literal — '$name' stays as literal text Subexpression for complex — "Count: $($arr.Count)" for properties/methods Here-strings for multiline — @" ... "@ or @' ... '@ Backtick escapes — `n for newline, `t for tab

Pipeline

$_ or $PSItem is current object — same thing, $_ more common ForEach-Object for pipeline — foreach statement doesn't take pipeline -PipelineVariable saves intermediate — Get-Service -PV svc | Where ... Pipeline processes one at a time — unless function doesn't support streaming

Error Handling

$ErrorActionPreference sets default — Stop, Continue, SilentlyContinue -ErrorAction Stop per command — makes non-terminating errors terminating try/catch only catches terminating — set ErrorAction Stop first $? is last command success — $LASTEXITCODE for native commands

Common Mistakes

No space before { in if — if($x){ works but if ($x) { preferred = is assignment in conditions — use -eq for comparison Function return array unrolls — return ,@($arr) to keep array Get-Content returns lines array — -Raw for single string Select-Object creates new object — properties are copies, not references

Cross-Platform

pwsh is PowerShell 7+ — powershell is Windows PowerShell 5.1 Paths use / or \ — Join-Path for portable Environment vars: $env:VAR — works on all platforms Aliases differ across platforms — ls, cat may not exist, use full cmdlet names

Category context

Code helpers, APIs, CLIs, browser automation, testing, and developer operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
1 Docs
  • SKILL.md Primary doc