GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cmdlets should respect SwitchParameter values not presence alone by anamnavi · Pull Request #1925 · PowerShell/PSResourceGet

Conversation

@anamnavi

@anamnavi Anam Navied (anamnavi) commented Jan 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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
      • Issue filed:
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed
      • Issue filed:
  • Testing - New and feature
    • N/A or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
  • 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
All reactions
  • 👍 1 reaction
annavied_microsoft
WhatIf parameter should respect provided value instead of simply chec…
07ebbf2
…king presence
@anamnavi
Anam Navied (anamnavi) requested review from Sydney Smith (SydneyhSmith), Aditya Patwardhan (adityapatwardhan), alerickson and shammu1 as code owners January 9, 2026 22:11
@anamnavi

Anam Navied (anamnavi) commented Jan 9, 2026

Copy link
Copy Markdown
Member Author

/azp run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Jan 9, 2026

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Jan 13, 2026
View reviewed changes
@anamnavi
Anam Navied (anamnavi) merged commit c012d38 into master Jan 14, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@chris-peterson

Chris Peterson (chris-peterson) commented Feb 25, 2026

Copy link
Copy Markdown

🙇

thank you for fixing this (I just tripped on it)

updating my github action to use 1.2.0-rc3

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Chris Peterson (chris-peterson) pushed a commit to chris-peterson/publish-powershell that referenced this pull request Mar 12, 2026
@claude
Remove PSResourceGet pre-release pin workaround
708ae06
PSResourceGet 1.2.0 stable was released on 2026-03-11, which includes
fixes for both issues that required pinning to the rc3 pre-release:
- PowerShell/PSResourceGet#1868: Repository store init
- PowerShell/PSResourceGet#1925: -WhatIf:$false passthrough

The base dotnet/sdk:10.0 image now ships with the stable version,
so the manual install is no longer needed.

https://claude.ai/code/session_01Lmy77CrACfsGozXfECQerT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes
@alerickson alerickson Awaiting requested review from alerickson alerickson is a code owner
@SydneyhSmith Sydney Smith (SydneyhSmith) Awaiting requested review from SydneyhSmith SydneyhSmith is a code owner
@shammu1 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

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Explicitly Setting $whatif = $false Prevents Module Installation

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@anamnavi @chris-peterson @adityapatwardhan
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.