Skip to content

Fix Test-Remainder invocation to pass three arguments, not two.#12831

Merged
sdwheeler merged 2 commits intoMicrosoftDocs:mainfrom
derkallevombau:patch-1
Mar 10, 2026
Merged

Fix Test-Remainder invocation to pass three arguments, not two.#12831
sdwheeler merged 2 commits intoMicrosoftDocs:mainfrom
derkallevombau:patch-1

Conversation

@derkallevombau
Copy link
Copy Markdown
Contributor

You state: "The following example declares a Value parameter that's mandatory and a Remaining parameter that accepts all the remaining parameter values that are submitted to the function.

You try to demonstrate this with this invocation: Test-Remainder first one, two

But your "all the remaining parameter values" is merely one value: one, two is an array.
Thus, if you removed ValueFromRemainingArguments, the same invocation would yield the same output, so your example does not demonstrate the benefit of ValueFromRemainingArguments.
To fix it, three args have to be passed to the Cmdlet, not just two.

PR Summary

In the second arg, one, two, remove the comma to have three args in total that are passed to the Cmdlet.

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][contrib].
  • Style: This PR adheres to the [style guide][style].

You state: "The following example declares a Value parameter that's mandatory and a Remaining parameter that accepts **all the remaining parameter values** that are submitted to the function.

You want to demonstrate this with this invocation:
`Test-Remainder first one, two`

But your "all the remaining parameter values" is merely one value: `one, two` is an array.
Thus, if you removed `ValueFromRemainingArguments`, the same invocation would yield the same output, so your example **does not** demonstrate the benefit of `ValueFromRemainingArguments`.
To fix it, three args have to be passed to the Cmdlet, not just two.
Copilot AI review requested due to automatic review settings March 10, 2026 03:59
@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the PowerShell documentation example for ValueFromRemainingArguments so the invocation actually passes multiple separate remaining arguments, demonstrating the attribute’s behavior correctly.

Changes:

  • Adjusted Test-Remainder example invocation from one, two (single array argument) to one two (two distinct arguments).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@learn-build-service-prod
Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 69808ee:

✅ Validation status: passed

File Status Preview URL Details
reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md ✅Succeeded View (powershell-7.5)

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 47a3080:

✅ Validation status: passed

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

For more details, please refer to the build report.

@sdwheeler sdwheeler merged commit 6643ced into MicrosoftDocs:main Mar 10, 2026
4 of 5 checks passed
@derkallevombau derkallevombau deleted the patch-1 branch March 10, 2026 15:47
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.

3 participants