GeezerVison is showing github.com — Cmdlets should respect SwitchParameter values not presence alone by anamnavi · Pull Request #1925 · PowerShell/PSResourceGet
Conversation
Some parameter switches like -WhatIf, -PSGallery for certain cmdlets were not being checked and used logically in the correct manner. The previous code was simply checking if the parameter switch was supplied and if so, equating that to the value of the parameter switch being true. This meant that in a scenario like, -WhatIf:$false the code detected presence of the -WhatIf parameter and did not install the package. Now, switch parameter values are checked. For -PSGallery switch parameter in Register-PSResourceRepository providing -PSGallery:$false will mean PSGallery is not registered and no error is reported.
PR Summary
PR Context
Resolves #1805
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Make sure all
.h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
- Breaking changes
- None
- OR
- Documentation needed
- User-facing changes
- Not Applicable
- OR
- Documentation needed
- Testing - New and feature
- Tooling
- I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
- OR
- I have considered the user experience from a tooling perspective and enumerated concerns in the summary.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chris-peterson reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Azure Pipelines successfully started running 1 pipeline(s).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
alerickson
Awaiting requested review from alerickson
alerickson is a code owner
shammu1
Awaiting requested review from shammu1
shammu1 is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.