Skip to content

Correct operator precedence and unary operator grouping - #13367

Open
Dimitriy Leontev (dleontev) wants to merge 1 commit into
MicrosoftDocs:mainfrom
dleontev:docs/operator-precedence-13331
Open

Dimitriy Leontev (dleontev) wants to merge 1 commit into
MicrosoftDocs:mainfrom
dleontev:docs/operator-precedence-13331

Conversation

@dleontev

Copy link
Copy Markdown

PR Summary

Correct about_Operator_Precedence for Windows PowerShell 5.1 and PowerShell 7.4–7.7:

  • Group prefix unary operators at equal precedence, including -bnot, and distinguish prefix from postfix increment/decrement.
  • Separate unary comma from binary array construction, so the table shows unary negation binding before binary comma and subtraction.
  • Move ?? above comparisons in the PowerShell 7.x articles, preserving the 5.1 syntax.
  • Add short explanations using the issue's examples and update the article dates.

Fixes #13331.

Validation:

  • Passed 14 runtime cases and 8 AST-structure checks across Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.5. Checked unary grouping against the language specification and current parser source.
  • Markdownlint 0.42.0, with the repository's About-topic configuration, reports zero findings in all five changed articles. Local Markdown reference targets resolve, and the new tables fit within 70 source characters per line.
  • git diff --check passed. The full documentation build/publishing validation has not been run locally and remains for repository CI after submission.

AI assistance: Codex prepared the documentation edits and performed the local validation described above.

PR Checklist

  • Descriptive Title: This PR's title is a synopsis of the changes it proposes.
  • Summary: This PR's summary describes the scope and intent of the change.
  • Contributor's Guide: I have read the contributor's guide.
  • Style: This PR adheres to the style guide.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 06:17

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.

🟢 Approval recommended

No active review issues are reported for the versioned operator-precedence documentation updates.

No open issues 🎉

What changed in this PR

Updates the versioned about_Operator_Precedence documentation to address #13331 for Windows PowerShell 5.1 and PowerShell 7.4–7.7.

Changes:

  • Groups prefix unary operators at equal precedence and distinguishes prefix/postfix increment and decrement and unary/binary comma.
  • Places null-coalescing (??) above comparisons in the PowerShell 7.x articles, preserving 5.1 syntax.
  • Adds examples explaining operator grouping and refreshes article dates.
File Description
reference/​7.7/​Microsoft.PowerShell.Core/​About/​about_Operator_Precedence.md Corrects unary grouping and null-coalescing precedence; adds examples.
reference/​7.6/​Microsoft.PowerShell.Core/​About/​about_Operator_Precedence.md Applies the precedence corrections and examples to 7.6.
reference/​7.5/​Microsoft.PowerShell.Core/​About/​about_Operator_Precedence.md Applies the precedence corrections and examples to 7.5.
reference/​7.4/​Microsoft.PowerShell.Core/​About/​about_Operator_Precedence.md Applies the precedence corrections and examples to 7.4.
reference/​5.1/​Microsoft.PowerShell.Core/​About/​about_Operator_Precedence.md Corrects unary grouping and adds examples without introducing 7.x syntax.

Review effort: Balanced

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 394c14d:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.6)
reference/7.7/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.7)

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit c55f39e:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.6)
reference/7.7/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.7)

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit d27b4fb:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.6)
reference/7.7/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md ✅Succeeded View (powershell-7.7)

For more details, please refer to the build report.

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.

Incorrect operator precedence

2 participants