PowerShell Script Standards Cheat Sheet

Formatting, logging, and validation

Last Updated: November 21, 2025

Focus Areas

Focus
Validate inputs
Emit structured logs

Commands & Queries

Invoke-ScriptAnalyzer script.ps1
Lint script
Write-Verbose 'Message'
Log actions
param([string]$Name)
Define parameters

Summary

Standards improve maintainability and clarity for PowerShell.

💡 Pro Tip: Run `PSScriptAnalyzer` before commits.
← Back to Developer Tools | Browse all categories | View all cheat sheets