Problem
A repository-wide script check still finds multiple .ps1 files that do not follow the MSX PowerShell script baseline (#Requires -Version, script-level [CmdletBinding()], param(), and $ErrorActionPreference = 'Stop').
Current status
A first pass has already aligned the workflow/deployment scripts under:
.github/scripts/docs/*.ps1
.github/actions/update-index/src/Invoke-UpdateIndex.ps1
- helper module naming for the
update-index action (update-index.Helpers.psm1)
Remaining files flagged
.github/scripts/docs/Shared.ps1 (helper script shape differs from entry-script baseline)
guidance/*.ps1 examples:
Add-Array.ps1
Add-HashTable.ps1
Add-String.ps1
Caller.ps1
ClassExtension.ps1
Loops.ps1
Out-Null.ps1
PipelineExecution.ps1
PSCallStack.ps1
PSCmdlet.ps1
Read-File.ps1
root.ps1
WebCalls.ps1
Proposed resolution
- Decide policy for
guidance/*.ps1 (strict runnable-script baseline vs snippet-style examples).
- If strict baseline applies, align each file to the standard structure and help format.
- If snippet style is intentional, document the exception clearly in repo guidance and exclude from baseline checks.
- Normalize
Shared.ps1 by either:
- converting it to a helper module (
*.psm1) with explicit import usage, or
- documenting why helper script format is intentionally exempt.
Problem
A repository-wide script check still finds multiple
.ps1files that do not follow the MSX PowerShell script baseline (#Requires -Version, script-level[CmdletBinding()],param(), and$ErrorActionPreference = 'Stop').Current status
A first pass has already aligned the workflow/deployment scripts under:
.github/scripts/docs/*.ps1.github/actions/update-index/src/Invoke-UpdateIndex.ps1update-indexaction (update-index.Helpers.psm1)Remaining files flagged
.github/scripts/docs/Shared.ps1(helper script shape differs from entry-script baseline)guidance/*.ps1examples:Add-Array.ps1Add-HashTable.ps1Add-String.ps1Caller.ps1ClassExtension.ps1Loops.ps1Out-Null.ps1PipelineExecution.ps1PSCallStack.ps1PSCmdlet.ps1Read-File.ps1root.ps1WebCalls.ps1Proposed resolution
guidance/*.ps1(strict runnable-script baseline vs snippet-style examples).Shared.ps1by either:*.psm1) with explicit import usage, or