In the situation where there is a boolean parameter and the parameter is part of one of the checks for value before use the logic in the functions treats a false as do not do the logic
I struck this when trying to use the New-OktaUser function and passing false to the activate function to prevent an email activation.
The example/scenario is
-
Call the New-OktaUser -Body $body -Activate $false
-
In the function this hits this line https://github.com/okta/okta-powershell-cli/blob/b01fd0a387e16d082ca833888fba9679a63527e9/src/Okta.PowerShell/Api/OktaUserApi.ps1#L626-628
-
This logic reads the parameter and skips setting the value in the dictionary as $Activate is false
-
The call to the API is made and the APIs value for this when not provided is True
-
User is created and activated and messages get sent
From the code it looks like the logic is meant to be if this parameter was provided, ,but the logic is off