Skip to content

XS⚠️ ◾ Enable PowerShell strict mode - #833

Merged
Muiris Woulfe (muiriswoulfe) merged 2 commits into
mainfrom
enable-powershell-strict-mode
Aug 14, 2026
Merged

XS⚠️ ◾ Enable PowerShell strict mode#833
Muiris Woulfe (muiriswoulfe) merged 2 commits into
mainfrom
enable-powershell-strict-mode

Conversation

@muiriswoulfe

Copy link
Copy Markdown
Member

This pull request introduces several improvements to the project's PowerShell workflow and action scripts. The main changes are the addition of strict mode enforcement for better script reliability.

Script reliability and consistency:

  • Added Set-StrictMode -Version Latest to all PowerShell scripts in .github/actions and .github/workflow-scripts to enforce stricter error handling and catch common scripting mistakes. [1] [2] [3] [4] [5]=

@microsoft-pr-metrics

Copy link
Copy Markdown
Contributor

PR Metrics

Thanks for keeping your pull request small.
⚠️ Consider adding additional tests.

Lines
Product Code 18
Test Code 2
Subtotal 20
Ignored Code -
Total 20

Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs!

@microsoft-pr-metrics microsoft-pr-metrics Bot changed the title Enable PowerShell strict mode XS⚠️ ◾ Enable PowerShell strict mode Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds PowerShell strict mode across workflow and action scripts to catch scripting errors earlier.

Changes:

  • Enables Set-StrictMode -Version Latest in all five PowerShell scripts.
  • Reworks license separator detection for strict-mode compatibility.
  • Introduces an unresolved strict-mode issue in token-script error paths.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflow-scripts/Update-Version.ps1 Enables strict mode during release version updates.
.github/workflow-scripts/Update-ThirdPartyNotices.ps1 Enables strict mode during notice generation.
.github/workflow-scripts/Update-Licenses.ps1 Enables strict mode and safely locates license separators.
.github/workflow-scripts/Test-Changes.ps1 Enables strict mode when detecting repository changes.
.github/actions/mint-github-app-token/New-GitHubAppToken.ps1 Enables strict mode for GitHub App token generation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/actions/mint-github-app-token/New-GitHubAppToken.ps1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/actions/mint-github-app-token/New-GitHubAppToken.ps1:13

  • The current revision still enables strict mode while directly reading potentially absent properties later in this script ($_.ErrorDetails.Message, $response.value, $installation.id, and $accessToken.token). Under strict mode, connection errors or malformed API responses therefore throw property-access errors before the intended fallback/diagnostic runs. Please apply the strict-mode-safe property checks and focused tests described in the resolved thread; they are not present in this revision.
Set-StrictMode -Version Latest

@muiriswoulfe
Muiris Woulfe (muiriswoulfe) merged commit 719393f into main Aug 14, 2026
36 checks passed
@muiriswoulfe
Muiris Woulfe (muiriswoulfe) deleted the enable-powershell-strict-mode branch August 14, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants