You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PowerShell 7.5 with Microsoft.PowerShell.PSResourceGet (version 1.1.1), explicitly setting $whatif to $false prevents the module from being installed
Example:
$whatif=$false
Install-PSResource -Name Microsoft.Entra -WhatIf:$whatif -Scope AllUsers
Name Value
---------
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
I can create a separate issue for this if desired. Or perhaps this current issue can be repurposed to address all instances of the problem in PSResourceGet.
Activity
sdwheeler commentedon Mar 21, 2025
This is the same problem with other cmdlets that was reported in PowerShell/PowerShell#25015. The logic for testing switch parameters is not correct.
sdwheeler commentedon Mar 21, 2025
The problem is here:
PSResourceGet/src/code/InstallHelper.cs
Line 675 in 89ca445
Besides testing for the parameter set or if the parameter exists, it should also test the value of the parameter.
surfingoldelephant commentedon Mar 26, 2025
This is also ignored:
I can create a separate issue for this if desired. Or perhaps this current issue can be repurposed to address all instances of the problem in
PSResourceGet.sdwheeler commentedon Mar 26, 2025
I think the current issue is enough. They need to look at all SwitchParamter instances.