powershell-windows

Correct Windows PowerShell scripts for operator precedence, null handling, and JSON serialization.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/capaas2/Site-teste --skill powershell-windows-capaas2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: powershell-windows
Source: https://github.com/capaas2/Site-teste/tree/main/.agent/skills/powershell-windows
Command: npx skills add https://github.com/capaas2/Site-teste --skill powershell-windows-capaas2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid common PowerShell-on-Windows pitfalls such as incorrect operator usage, null-reference errors, unsafe path handling, and broken JSON serialization.

Core Features & Use Cases

  • Operator Syntax Guidance: Ensures cmdlet calls are wrapped correctly when combined with logical operators.
  • Safe Scripting Patterns: Promotes null checks, proper error handling, and ASCII-only output for reliable Windows automation.
  • File, Array, and JSON Handling: Provides practical patterns for paths, arrays, and nested JSON operations.
  • Use Case: When writing a script to read configuration, validate input, and update a JSON file, this Skill guides you toward robust, predictable PowerShell code.

Quick Start

Use the powershell-windows skill to review and correct a Windows PowerShell script for operator syntax, null checks, and JSON handling.

Frequently Asked Questions about powershell-windows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix PowerShell scripting errors caused by operator precedence on Windows?

PowerShell scripting errors from operator precedence are fixed by wrapping cmdlet calls in parentheses when combining them with logical operators, ensuring safe script patterns and reliable Windows automation behavior.

What is the best way to handle null values and errors in Windows PowerShell scripts?

Handling null values and errors in Windows PowerShell requires explicit null checks, proper error handling patterns, and ASCII-only output to ensure predictable script execution and avoid null-reference exceptions during automation.

How do I safely construct file paths and handle arrays in PowerShell on Windows?

Safely constructing file paths and handling arrays in PowerShell on Windows involves applying safe path handling patterns to prevent traversal errors and using proper array manipulation techniques for reliable file operations.

Why does ConvertTo-Json break nested objects in PowerShell and how do I fix it?

ConvertTo-Json breaks nested objects in PowerShell because it lacks sufficient serialization depth by default; applying the -Depth parameter during nested JSON conversion fixes the broken JSON serialization.

Does this PowerShell guidance apply to maintenance scripts and troubleshooting scenarios?

This PowerShell guidance applies directly to automation tasks, maintenance scripts, and troubleshooting scenarios where reliable Windows PowerShell behavior, safe script patterns, and predictable execution are required.