Skip to content

New Tip Submission - Ignore this field and fill in the ones below #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ChristelVDH opened this issue Apr 18, 2025 · 4 comments · Fixed by #127
Closed

New Tip Submission - Ignore this field and fill in the ones below #126

ChristelVDH opened this issue Apr 18, 2025 · 4 comments · Fixed by #127
Labels
automation-new-tip-issue-do-not-use Used by automation to create PRs from New PowerShell Tip issues

Comments

@ChristelVDH
Copy link
Contributor

ChristelVDH commented Apr 18, 2025

Tip Title

Capture superfluous parameters passed to your function(s)

Tip Text

Capture any parsed parameter to prevent a function from bombing out when being passed unknown / misspelled variables.
Comes in handy when parsing the $PSBoundParameters from a calling script with just a subset of parameters that are appropriate / needed by your (custom) function.

Example Code (optional)

[CmdletBinding()]
param(
[Parameter(DontShow, ValueFromRemainingArguments)]$Superfluous
)

Write-Verbose -Message "Ignoring superfluous params: $($Superfluous -join ' ')"

Category

Syntax

URL 1 (optional)

https://github.com/ChristelVDH/SyncAD2AAD/blob/main/ConnectTo-Graph.ps1

URL 2 (optional)

https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.parameterattribute.valuefromremainingarguments

URL 3 (optional)

https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.parameterattribute.dontshow

Author (optional)

Christel VdH

Expiry Date (optional)

No response

Git Display Name and GitHub Email (optional)

Christel VdH christel.vanderherten@kicts.be

@ChristelVDH ChristelVDH added the automation-new-tip-issue-do-not-use Used by automation to create PRs from New PowerShell Tip issues label Apr 18, 2025
Copy link

Thank you for your submission! 🙏

A pull request is being created for your tip via the following GitHub Actions workflow run and should be linked to this issue shortly... ⏱️

https://github.com/deadlydog/PowerShell.tiPS/actions/runs/14531071871

Copy link

Thanks for contributing! 🙌

A pull request has been created for your tip. You can view it at PR #127.

Subscribe to the PR to receive notifications for any comments and to see when your tip has been merged into tiPS.

If the PR check fails due to a spelling mistake, or you want to update the tip information, you can edit the issue description and it will automatically re-run the workflow to update the PR.

This issue will be automatically closed when the PR is merged.

Copy link

Thank you for your submission! 🙏

A pull request is being created for your tip via the following GitHub Actions workflow run and should be linked to this issue shortly... ⏱️

https://github.com/deadlydog/PowerShell.tiPS/actions/runs/14541384227

Copy link

Thanks for contributing! 🙌

A pull request has been created for your tip. You can view it at PR #127.

Subscribe to the PR to receive notifications for any comments and to see when your tip has been merged into tiPS.

If the PR check fails due to a spelling mistake, or you want to update the tip information, you can edit the issue description and it will automatically re-run the workflow to update the PR.

This issue will be automatically closed when the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation-new-tip-issue-do-not-use Used by automation to create PRs from New PowerShell Tip issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant