Skip to content

Conversation

@littleKitchen
Copy link
Contributor

Summary

Add standardized requirements header block to all 13 production PowerShell scripts for consistent error handling, PowerShell version requirements, and strict mode enforcement.

Changes

  • Added #Requires -Version 7.0 before param() block
  • Added Set-StrictMode -Version Latest after param() block
  • Added $ErrorActionPreference = 'Stop' after Set-StrictMode
  • Removed duplicate $ErrorActionPreference assignments from script bodies

Files Modified (13 total)

  • scripts/linting/*.ps1 (6 files)
  • scripts/security/*.ps1 (3 files)
  • scripts/extension/*.ps1 (2 files)
  • scripts/lib/Get-VerifiedDownload.ps1
  • scripts/dev-tools/Generate-PrReference.ps1

Validation

  • ✅ PSScriptAnalyzer passes with no new issues
  • ✅ All 13 scripts have standardized header block
  • ✅ No duplicate $ErrorActionPreference assignments

Fixes #286

…soft#286)

Add standardized header block to all 13 production PowerShell scripts:
- #Requires -Version 7.0 (before param block)
- Set-StrictMode -Version Latest (after param block)
- $ErrorActionPreference = 'Stop' (after Set-StrictMode)

Files modified:
- scripts/linting/*.ps1 (6 files)
- scripts/security/*.ps1 (3 files)
- scripts/extension/*.ps1 (2 files)
- scripts/lib/Get-VerifiedDownload.ps1
- scripts/dev-tools/Generate-PrReference.ps1

Removed duplicate $ErrorActionPreference assignments from script bodies.

Fixes microsoft#286
@littleKitchen littleKitchen requested a review from a team as a code owner January 31, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize PowerShell script requirements header block

1 participant