Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

powershell-expert

БесплатноЗапускает вложенные скриптыНе проверен

PowerShell 7+ scripting and Windows system administration -- cross-platform automation, secure credential handling, Pester testing, DSC, and JEA patterns.

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

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

  1. ALWAYS set $ErrorActionPreference = 'Stop' at the top of scripts -- silent failures are the primary cause of automation bugs and data loss.
  2. NEVER hardcode credentials or secrets in scripts -- use Microsoft.PowerShell.SecretManagement module to pull secrets from vaults.
  3. ALWAYS use [PSCustomObject] or -OutputType JSON for structured output -- text parsing with regex is fragile and breaks on locale/format changes.
  4. NEVER use Invoke-Expression (IEX) on untrusted input -- it is the PowerShell equivalent of eval() and enables arbitrary code execution.
  5. ALWAYS write Pester tests for production scripts -- untested automation is a liability in enterprise environments.

Anti-Patterns

Anti-Pattern Why It Fails Correct Approach
Parsing command output with regex instead of using objects Breaks on locale changes, format updates, and different OS versions Use cmdlet object output directly or convert to PSCustomObject
Using Invoke-Expression to build dynamic commands Enables code injection; any user input can execute arbitrary PowerShell Use splatting (@params) for dynamic parameters; use Start-Process for external commands
Catching all exceptions with empty catch blocks Silently swallows errors; automation appears to succeed when it failed Use typed catch blocks; log and re-throw unexpected exceptions
Using Windows PowerShell 5.1 syntax without checking compatibility Scripts fail on Linux/macOS where PS 7 is the only option Use $PSVersionTable.PSVersion checks; prefer PS 7 cross-platform cmdlets
Storing credentials in script variables or config files Plaintext secrets in source control; credential theft risk Use Get-Secret from SecretManagement module; inject via environment variables in CI

Workflow

Step 1: Script Structure

#Requires -Version 7.0
#Requires -Modules @{ ModuleName='Microsoft.PowerShell.SecretManagement'; ModuleVersion='1.1.0' }

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

function Invoke-DataBackup {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$TargetPath,

        [Parameter()]
        [switch]$Compress
    )

    begin {
        Write-Verbose "Starting backup to $TargetPath"
    }

    process {
        try {
            # Business logic here
        }
        catch [System.IO.IOException] {
            Write-Error "IO error during backup: $_"
            throw
        }
        catch {
            Write-Error "Unexpected error: $_"
            throw
        }
    }

    end {
        Writ
Полный SKILL.md на GitHub

Установить powershell-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob
WebSearch
WebFetch

Вложенные файлы

commands/powershell-expert.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/.gitkeepreferences/best-practices.mdreferences/devops-integration.mdreferences/module-authoring.mdreferences/performance-patterns.mdreferences/research-requirements.mdreferences/security-patterns.mdreferences/testing-patterns.mdrules/powershell-expert.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл powershell-expert?

PowerShell 7+ scripting and Windows system administration -- cross-platform automation, secure credential handling, Pester testing, DSC, and JEA patterns.

Как установить скилл powershell-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл powershell-expert запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить powershell-expert с