Skip to content

Conversation

@anamnavi
Copy link
Member

@anamnavi anamnavi commented Jan 9, 2026

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

@anamnavi
Copy link
Member Author

anamnavi commented Jan 9, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

Explicitly Setting $whatif = $false Prevents Module Installation

2 participants