lang-ps1

Enforce PowerShell scripting standards with PSScriptAnalyzer and Pester.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/dragoscirjan/opencode-config --skill lang-ps1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lang-ps1
Source: https://github.com/dragoscirjan/opencode-config/tree/main/skills/lang-ps1
Command: npx skills add https://github.com/dragoscirjan/opencode-config --skill lang-ps1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write PowerShell that is consistent, maintainable, and safer to run by turning scattered scripting habits into a clear set of standards.

Core Features & Use Cases

  • Style Guidance: Follows PowerShell Practice and Style for readable, professional scripts.
  • Tooling Standards: Encourages PSScriptAnalyzer and Pester for linting and testing.
  • Pipeline-Friendly Design: Promotes object output, approved verbs, and advanced functions that integrate cleanly with other commands.
  • Safety and Reliability: Reinforces CmdletBinding, explicit error handling with ErrorAction Stop, and prerequisite checks with #Requires.
  • Use Case: Use this Skill when building a reusable administration script, a module function, or a CI-tested automation workflow that must behave predictably.

Quick Start

Ask the assistant to review or write your PowerShell script according to these standards and to apply clean-code principles alongside lang-ps1.

Frequently Asked Questions about lang-ps1

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

FAQPage Schema
How do I enforce consistent PowerShell scripting standards across my team?

Enforce consistent PowerShell scripting standards by applying approved verbs, CmdletBinding, and ErrorAction Stop to your functions. This ensures your team's automation scripts and modules remain maintainable, readable, and safer to run.

How do I use PSScriptAnalyzer and Pester to test PowerShell automation scripts?

You use PSScriptAnalyzer for linting script style and Pester for running tests in your CI-tested utilities. This combination validates your PowerShell codebase against safe function patterns and reliable tooling practices before deployment.

What are the requirements for writing safe PowerShell module functions?

Writing safe PowerShell module functions requires using CmdletBinding, explicit error handling with ErrorAction Stop, and adding #Requires checks for prerequisites. You must also output objects instead of text to ensure pipeline-friendly design.

Does PowerShell automation work better with approved verbs and object-based output?

Yes, PowerShell automation works better with approved verbs and object-based output because it promotes pipeline-friendly design. This allows your advanced functions to integrate cleanly with other commands in a predictable manner.

What is the best way to standardize PowerShell codebases for CI-tested utilities?

The best way to standardize PowerShell codebases for CI-tested utilities is to follow PowerShell Practice and Style guidelines. This turns scattered scripting habits into clear standards for reliable tooling and safe function patterns.

Why do I need #Requires checks in my PowerShell scripts?

You need #Requires checks in your PowerShell scripts to guarantee prerequisite conditions are met before execution. This reinforces safety and reliability by preventing scripts from running in incompatible environments.