Skip to content

fix: skip default restart check when custom restart_check_command is provided - #13654

Open
AruneshDwivedi wants to merge 1 commit into
hashicorp:mainfrom
AruneshDwivedi:fix/windows-restart-custom-check-command
Open

fix: skip default restart check when custom restart_check_command is provided#13654
AruneshDwivedi wants to merge 1 commit into
hashicorp:mainfrom
AruneshDwivedi:fix/windows-restart-custom-check-command

Conversation

@AruneshDwivedi

@AruneshDwivedi AruneshDwivedi commented Jun 5, 2026

Copy link
Copy Markdown

The windows-restart provisioner runs DefaultRestartCheckCommand ([System.Net.Dns]::GetHostName()) even when the user provides a custom restart_check_command. This breaks Windows Constrained Language Mode because the .NET call isn't allowed.

The fix adds a break after running the custom restart check, so the default check is skipped when a custom one is provided.

Fixes #13654

…provided

When a user provides a custom restart_check_command to the windows-restart
provisioner, the DefaultRestartCheckCommand (which uses [System.Net.Dns]::GetHostName())
was still being executed afterward. This breaks Windows Constrained Language Mode
because that .NET call is not allowed in constrained mode.

Fix: when a custom restart_check_command is provided, skip the default
PowerShell module-load check entirely. The user's custom command is sufficient
to verify the restart.

Fixes hashicorp#13643
@AruneshDwivedi
AruneshDwivedi requested a review from a team as a code owner June 5, 2026 08:36
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jun 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@AruneshDwivedi

Copy link
Copy Markdown
Author

/check-cla

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.

1 participant