Repository navigation
Conversation
PowerShell is not case sensitive, so the parameter and the variable were considered to be the same. fixes Set-D365WebServerType is not working Fixes d365collaborative#927
This pull request was automatically created by the d365fo.tools-Generate-Text action'
|
@Splaxi Pinging you as reviewer since I added a reference implementation of the ShouldProcess support that I would like to see more in our cmdlets. |
| ) | ||
|
|
||
| begin { | ||
| if ($Force -and -not $PSBoundParameters.ContainsKey('Confirm')) { |
There was a problem hiding this comment.
didn't we have this discussion once? That contains would fire if -Confirm:$false?
We should be able to have it be simpler with $Confirm
I'm not entirely sure
There was a problem hiding this comment.
@Splaxi
I was following the guidance in ShouldProcess on that. -Confirm:$false would be the one of the intended ways to override the confirmation behavior, the other would be changing the $ConfirmPreference. But since users are more familiar with the -Force parameter, they tend to use that in an attempt to get rid of confirmations. This basically makes it so that -Force works like -Confirm:$false. I think this works in this case because -Force is not used to control other behavior.
In any case, since the ConfirmImpact is set to 'Low', most users will never run into unwanted confirmations. Either you set $ConfirmPreference to 'Low' before running the command (which means you seem to know what you are doing) or you are using the -Confirm switch (out of curiosity or because you know what you are doing).
|
I see some changes to the CBH. Maybe you and I are running different mechanics - that formats. Let's align, so we don't see drift like that show up all the time... |
I'm using https://github.com/d365collaborative/d365fo.tools/actions/workflows/update-generated-text.yml. Might be because it is running on a unix agent that causes the diffs. |
Unix -> Most likely is the cause |
Fixes #429 by renaming the internal variable for the xml node where the
RuntimeHostTypeis stored.Also enhances the
Set-D365WebServerTypecmdlet by adding support for PowerShell's-WhatIf,-Confirm, and a new-Forceparameter, improving safety and flexibility when making configuration changes.