Skip to content

Fix parameter variable name conflict #927 - #928

Merged
FH-Inway merged 7 commits into
d365collaborative:masterfrom
FH-Inway:fix-parameter-variable-name-conflict-927
Oct 19, 2026
Merged

FH-Inway merged 7 commits into
d365collaborative:masterfrom
FH-Inway:fix-parameter-variable-name-conflict-927

Conversation

@FH-Inway

Copy link
Copy Markdown
Member

Fixes #429 by renaming the internal variable for the xml node where the RuntimeHostType is stored.

Also enhances the Set-D365WebServerType cmdlet by adding support for PowerShell's -WhatIf, -Confirm, and a new -Force parameter, improving safety and flexibility when making configuration changes.

@FH-Inway
FH-Inway requested a review from Splaxi September 26, 2026 13:20
@FH-Inway

Copy link
Copy Markdown
Member Author

@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')) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).

@Splaxi

Splaxi commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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...

@FH-Inway

Copy link
Copy Markdown
Member Author

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.

@Splaxi

Splaxi commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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

@FH-Inway

Copy link
Copy Markdown
Member Author

@Splaxi Are there any changes you would like to see before approval? I will take a look at the CBH drifts at a later time, but I don't think it is necessary to block this pr for that. We've been living with the drifts for a while now, a few more are acceptable I think.

Comment on lines +21 to +29
.PARAMETER Confirm
Switch parameter to require confirmation before making changes.

.PARAMETER WhatIf
Switch parameter to show what would happen if the cmdlet runs, without making any changes.

.PARAMETER Force
Switch parameter to force the operation without confirmation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would "hate" that we would have to have documentation for all 3 standard parameter, across all cmdlets.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FH-Inway - If we could settle without these, at least over time - then I'm happy.

We'll have to face what operations / actions should be medium or high - so people can accept things, without having to manage Confirm.

If we start with low - then all people will have non-breaking changes, while you can set "low" on your profile and you will be prompted.

Then over time, we can gradually promote different functions / cmdlets, to different levels.

@Splaxi
Splaxi self-requested a review October 19, 2026 12:24

@Splaxi Splaxi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take the feedback as non-blocking

@FH-Inway
FH-Inway merged commit 5f2c097 into d365collaborative:master Oct 19, 2026
5 checks passed
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.

typing Y in Remove-D365Model and Install-D365Model

2 participants