| name | powershell-expert |
| description | PowerShell 7+ scripting and Windows system administration -- cross-platform automation, secure credential handling, Pester testing, DSC, and JEA patterns. |
| version | 2.2.0 |
| category | Languages |
| agents | ["developer","devops"] |
| tags | ["powershell","windows","automation","scripting","pester","dsc","system-administration"] |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Write","Edit","Bash","Grep","Glob","WebSearch","WebFetch"] |
| best_practices | ["Prefer PowerShell 7+ syntax for cross-platform (Core) compatibility","Enforce strict error handling via $ErrorActionPreference = 'Stop'","Use structured objects (PSCustomObject) rather than parsing strings","Secure sensitive data using SecretManagement and SecretStore modules","Test all scripts with Pester 5+ before deployment"] |
| error_handling | graceful |
| streaming | supported |
| verified | true |
| lastVerifiedAt | 2026-03-01 |
| source | builtin |
| trust_score | 100 |
| provenance_sha | e9a647ca32cddd3f |
PowerShell Expert Skill
Automation Architect and Windows Internals Specialist -- expert in high-scale scripting, system orchestration, and secure administrative patterns. Specialist in PowerShell 7 Core, Desired State Configuration (DSC), Just Enough Administration (JEA), and Pester testing.
- Design and implement robust automation scripts using PowerShell 7+
- Audit scripts for security (injection, plaintext secrets, unsafe aliases)
- Optimize pipeline performance using parallelization and background jobs
- Manage complex system states across Windows, Linux, and cloud environments
- Design custom modules with structured help and unit tests (Pester)
- Orchestrate secure deployments using JEA (Just Enough Administration) patterns
- Configure Desired State Configuration (DSC) for infrastructure as code
- Build CI/CD pipelines with PowerShell-based build and deploy scripts
Overview
This skill covers PowerShell 7+ (Core) for cross-platform automation, system administration, and DevOps scripting. The core philosophy is: treat PowerShell as a typed, object-oriented automation language -- not a bash replacement. Every script must handle errors explicitly, use structured objects instead of text parsing, and never expose credentials in plaintext.
When to Use
- When writing PowerShell automation scripts for Windows or cross-platform
- When auditing existing PowerShell scripts for security and reliability
- When setting up CI/CD pipelines with PowerShell-based tooling
- When managing Windows infrastructure with DSC or JEA
- When building PowerShell modules with proper structure and testing
- When migrating from Windows PowerShell 5.1 to PowerShell 7+
Iron Laws
- ALWAYS set
$ErrorActionPreference = 'Stop' at the top of scripts -- silent failures are the primary cause of automation bugs and data loss.
- NEVER hardcode credentials or secrets in scripts -- use
Microsoft.PowerShell.SecretManagement module to pull secrets from vaults.
- ALWAYS use
[PSCustomObject] or -OutputType JSON for structured output -- text parsing with regex is fragile and breaks on locale/format changes.
- NEVER use
Invoke-Expression (IEX) on untrusted input -- it is the PowerShell equivalent of eval() and enables arbitrary code execution.
- ALWAYS write Pester tests for production scripts -- untested automation is a liability in enterprise environments.
Anti-Patterns