powershell

Enforce enterprise PowerShell coding standards for writing, reviewing, and generating PS1 scripts.

4|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/dstreefkerk/claude-skills --skill powershell-dstreefkerk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: powershell
Source: https://github.com/dstreefkerk/claude-skills/tree/main/plugins/powershell/skills/powershell
Command: npx skills add https://github.com/dstreefkerk/claude-skills --skill powershell-dstreefkerk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures your PowerShell code adheres to strict enterprise standards for structure, error handling, security, and performance, preventing common bugs and improving maintainability.

Core Features & Use Cases

  • Code Generation & Review: Write new PowerShell scripts or functions following best practices, or have existing code reviewed against these standards.
  • Error Handling & Debugging: Implement robust try/catch blocks, check exit codes, and avoid common pipeline pitfalls.
  • Security Hardening: Enforce secure credential handling, avoid Invoke-Expression, and ensure CLM compatibility.
  • Performance Optimization: Apply patterns that significantly improve script execution speed.
  • Use Case: You need to write a PowerShell script to manage Active Directory users. This Skill will guide you to create a robust, secure, and efficient script that includes proper parameter handling, error trapping, and logging.

Quick Start

Use the powershell skill to write a PowerShell script that retrieves all services on a remote machine and outputs their status.

Frequently Asked Questions about powershell

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

FAQPage Schema
How do I write enterprise-grade PowerShell scripts with proper error handling?

Enterprise-grade PowerShell scripts require robust try/catch blocks, strict mode, cmdlet binding, and proper error action preferences to prevent common bugs. Implementing these coding standards ensures your scripts handle errors gracefully and maintain high reliability.

What is the best way to secure credentials and avoid security pitfalls in PowerShell scripting?

Secure PowerShell scripting requires enforcing secure credential handling and avoiding Invoke-Expression to ensure CLM compatibility. Applying these security hardening patterns protects sensitive data and prevents unauthorized code execution within your enterprise environment.

How do I optimize PowerShell script performance for tasks like managing Active Directory?

PowerShell performance optimization involves applying specific patterns that significantly improve script execution speed, such as avoiding common pipeline pitfalls. These adjustments are crucial when your scripts process large datasets or manage bulk operations like Active Directory users.

Why does my PowerShell code fail to adhere to strict coding standards during review?

PowerShell code often fails enterprise reviews due to missing strict mode, improper parameter handling, or lack of cmdlet binding. Enforcing strict coding standards for structure and output patterns ensures your functions pass code reviews and maintain long-term stability.

Can I use this Skill to review existing PS1 scripts for debugging and best practices?

Yes, you can review existing PS1 scripts and functions against enterprise PowerShell coding standards. This process checks for proper error handling, security configurations, and performance patterns, helping you debug issues and align your code with best practices.

When do I need to use strict mode and cmdlet binding in PowerShell functions?

Strict mode and cmdlet binding are needed in PowerShell functions when you require robust parameter handling and strict error action preferences. Using these features enforces enterprise-grade coding standards, preventing silent failures and ensuring predictable script execution.