powershell-windows

Fix PowerShell Windows script patterns for runtime errors.

8.1k|1.5k|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/vudovn/antigravity-kit --skill powershell-windows-vudovn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: powershell-windows
Source: https://github.com/vudovn/antigravity-kit/tree/main/.agent/skills/powershell-windows
Command: npx skills add https://github.com/vudovn/antigravity-kit --skill powershell-windows-vudovn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Windows PowerShell scripting often suffers from pitfalls in operator precedence, null checks, and ASCII-only scripting; this Skill provides concise patterns and best practices to write robust PowerShell on Windows.

Core Features & Use Cases

  • Critical syntax rules for logical operators and parentheses in PowerShell scripts.
  • Null checks, string handling, error handling, and cross-platform path practices.
  • Use Case: A sysadmin refactors a legacy script to safely validate inputs and handle errors across Windows hosts.

Quick Start

Start by applying the recommended patterns to a sample script, focusing on correcting operator precedence, ASCII-only rules, and robust null checks.

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 operator precedence issues in Windows scripts?

Fix PowerShell operator precedence by enforcing parentheses around all logical operations. This prevents runtime errors caused by unexpected evaluation order in conditional logic and ensures robust script execution.

What is the best way to handle null checks in PowerShell?

The best way to handle null checks in PowerShell is to standardize validation patterns before processing inputs. Consistent null checks prevent null reference exceptions and ensure scripts safely validate data across Windows hosts.

How do I normalize cross-version path handling in PowerShell scripts?

Normalize cross-version path handling in PowerShell by applying standardized path practices. This ensures scripts execute reliably across different Windows hosts and avoids file access errors caused by inconsistent path formats.

Why does my PowerShell script fail with non-ASCII characters?

PowerShell scripts fail with non-ASCII characters because Windows environments often lack consistent encoding support. Enforcing ASCII-only coding prevents character encoding errors and ensures robust execution across all Windows hosts.

How do I implement error handling for Windows automation tasks in PowerShell?

Implement error handling for Windows automation tasks by applying standardized patterns for catching and managing runtime exceptions. This approach ensures scripts handle failures gracefully and maintain execution stability.