
Powershell Master
Stand up PowerShell-based CI on GitHub Actions, Azure DevOps, or Bitbucket with Pester tests and PSScriptAnalyzer gates.
Overview
powershell-master is an agent skill for the Ship phase that documents PowerShell CI/CD integration for GitHub Actions, Azure DevOps, and Bitbucket with Pester and PSScriptAnalyzer steps.
Install
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill powershell-masterWhat is this skill?
- GitHub Actions workflow template with pwsh steps for Pester and PSScriptAnalyzer
- Multi-platform matrix example across ubuntu-latest, windows-latest, and macos-latest
- Azure DevOps PowerShell@2 inline and filePath task patterns for module install and test
- Bitbucket Pipelines orientation for PowerShell CI alongside GitHub and Azure samples
- Module bootstrap snippets for Pester and PSScriptAnalyzer with Force and CurrentUser scope
Adoption & trust: 532 installs on skills.sh; 42 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have PowerShell tests locally but no reliable template to run Pester and ScriptAnalyzer on every push across cloud CI platforms.
Who is it for?
Windows-leaning indie devs or small teams standardizing pwsh CI across GitHub, Azure DevOps, or Bitbucket.
Skip if: Pure bash/Linux pipelines with no PowerShell, or advanced DSC/Windows deployment topics not covered in the CI snippets.
When should I use this skill?
Configuring continuous integration for PowerShell projects on GitHub Actions, Azure DevOps Pipelines, or Bitbucket with Pester and PSScriptAnalyzer.
What do I get? / Deliverables
You leave with pipeline-ready YAML and task blocks that install modules, execute Pester with NUnit output, and enforce PSScriptAnalyzer on pull requests.
- CI workflow YAML with Pester test execution and NUnit XML output
- PSScriptAnalyzer gate step suitable for pull request pipelines
Recommended Skills
Journey fit
Canonical shelf is Ship testing because the skill content centers on automated test and analysis stages in CI pipelines. Testing matches Invoke-Pester runs, NUnit output, and ScriptAnalyzer summary steps in pipeline YAML.
How it compares
Skill-packaged CI YAML patterns for PowerShell—not a hosted runner product or generic shell linter skill.
Common Questions / FAQ
Who is powershell-master for?
Solo builders maintaining PowerShell scripts or modules who need hosted CI examples for GitHub Actions, Azure DevOps, or Bitbucket.
When should I use powershell-master?
Use it in Ship when adding or fixing CI testing—on push/PR workflows, matrix cross-OS tests, or Azure pipeline tasks that must run Invoke-Pester and Invoke-ScriptAnalyzer.
Is powershell-master safe to install?
Treat generated pipeline YAML like any CI change: review the Security Audits panel on this page, pin action versions, and scope module installs before enabling in production orgs.
SKILL.md
READMESKILL.md - Powershell Master
# PowerShell CI/CD Integration Reference for GitHub Actions, Azure DevOps Pipelines, and Bitbucket Pipelines with PowerShell. ## GitHub Actions ```yaml name: PowerShell CI on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install PowerShell modules shell: pwsh run: | Install-Module -Name Pester -Force -Scope CurrentUser Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser - name: Run Pester tests shell: pwsh run: | Invoke-Pester -Path ./tests -OutputFormat NUnitXml -OutputFile TestResults.xml - name: Run PSScriptAnalyzer shell: pwsh run: | Invoke-ScriptAnalyzer -Path . -Recurse -ReportSummary ``` ### Multi-Platform Matrix ```yaml jobs: test: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Test on ${{ matrix.os }} shell: pwsh run: | ./test-script.ps1 ``` ## Azure DevOps Pipelines ```yaml trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: PowerShell@2 inputs: targetType: 'inline' script: | Install-Module -Name Pester -Force -Scope CurrentUser Invoke-Pester -Path ./tests -OutputFormat NUnitXml displayName: 'Run Pester Tests' - task: PowerShell@2 inputs: filePath: '$(System.DefaultWorkingDirectory)/build.ps1' arguments: '-Configuration Release' displayName: 'Run Build Script' - task: PublishTestResults@2 inputs: testResultsFormat: 'NUnit' testResultsFiles: '**/TestResults.xml' ``` ### Cross-Platform Pipeline ```yaml strategy: matrix: linux: imageName: 'ubuntu-latest' windows: imageName: 'windows-latest' mac: imageName: 'macos-latest' pool: vmImage: $(imageName) steps: - pwsh: | Write-Host "Running on $($PSVersionTable.OS)" ./test-script.ps1 displayName: 'Cross-platform test' ``` ## Bitbucket Pipelines ```yaml image: mcr.microsoft.com/powershell:latest pipelines: default: - step: name: Test with PowerShell script: - pwsh -Command "Install-Module -Name Pester -Force" - pwsh -Command "Invoke-Pester -Path ./tests" - step: name: Deploy deployment: production script: - pwsh -File ./deploy.ps1 ``` # PowerShell Cross-Platform Patterns Reference for writing PowerShell that works on Windows, Linux, and macOS. ## Path Handling DO: ```powershell # Use Join-Path for cross-platform paths $configPath = Join-Path -Path $PSScriptRoot -ChildPath "config.json" # Use [System.IO.Path] for path manipulation $fullPath = [System.IO.Path]::Combine($home, "documents", "file.txt") # Forward slashes work on all platforms in PowerShell 7+ $path = "$PSScriptRoot/subfolder/file.txt" ``` DON'T: ```powershell # Hardcoded backslashes (Windows-only) $path = "C:\Users\Name\file.txt" # Assume case-insensitive file systems Get-ChildItem "MyFile.txt" # Works on Windows, fails on Linux/macOS if casing is wrong ``` ## Platform Detection ```powershell # Use automatic variables if ($IsWindows) { # Windows-specific code $env:Path -split ';' } elseif ($IsLinux) { # Linux-specific code $env:PATH -split ':' } elseif ($IsMacOS) { # macOS-specific code $env:PATH -split ':' } # Check PowerShell version if ($PSVersionTable.PSVersion.Major -ge 7) { # PowerShell 7+ features } ``` ## Avoid Aliases in Scripts ```powershell # DON'T use aliases (they may differ across platforms) ls | ? {$_.Length -gt 1MB} | % {$_.Name} # DO use full cmdlet names Get-ChildItem | Where-Object {$_.Length -gt 1MB} | ForEach-Object {$_.Name} ``` On Linux/macOS, aliases might invoke native commands instead of PowerShell cmdlets, causing unexpected results. ## Text Encoding ```powershell # PowerShell 7+ uses UTF-8 by defau