Skip to content

Fix parameter variable name conflict #927 - #928

Open
FH-Inway wants to merge 7 commits into
d365collaborative:masterfrom
FH-Inway:fix-parameter-variable-name-conflict-927
Open

FH-Inway wants to merge 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

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