fix(enterprise): correct domainSquattingEnabled replacement pattern - #175
Merged
Zacgoose merged 1 commit intoAug 12, 2026
Merged
Conversation
The setup script searched the downloaded templates for `$domainSquattingEnabled = 1 #`, but both Deploy and Detect ship the setting as `= 0 #`. Apply-Replacements matches with String.Contains, so the lookup missed, the pattern landed in $missing, and the script threw "Failed to customize the Deploy template" before writing any output files. This failed for every user regardless of the answers given at the prompts, and it was the only pattern of the 23 that did not match. Verified all 23 patterns against the current Deploy and Detect templates on main, then ran the replacement block end to end: every replacement applies and both generated scripts parse as valid PowerShell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes enterprise setup script generation by aligning the domainSquattingEnabled replacement pattern with the actual defaults in the Deploy/Detect PowerShell templates, preventing Setup-Windows-Chrome-and-Edge.ps1 from throwing and failing to produce Intune-ready output.
Changes:
- Update the
domainSquattingEnabledreplacement pattern from= 1 #to= 0 #to match shipped templates. - Restore successful template customization by ensuring
Apply-Replacementsfinds all expected patterns.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
229
to
233
| @{ Pattern = '$updateInterval = 24 #'; Value = "`$updateInterval = $cfg_updateInterval #" } | ||
| @{ Pattern = '$domainSquattingEnabled = 1 #'; Value = "`$domainSquattingEnabled = $cfg_domainSquattingEnabled #" } | ||
| @{ Pattern = '$domainSquattingEnabled = 0 #'; Value = "`$domainSquattingEnabled = $cfg_domainSquattingEnabled #" } | ||
| @{ Pattern = '$enableDebugLogging = 0 #'; Value = "`$enableDebugLogging = $cfg_enableDebugLogging #" } | ||
| @{ Pattern = '$enableGenericWebhook = 0 #'; Value = "`$enableGenericWebhook = $cfg_enableGenericWebhook #" } | ||
| @{ Pattern = '$webhookUrl = "" #'; Value = "`$webhookUrl = $(Format-SingleQuoted $cfg_webhookUrl) #" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setup-Windows-Chrome-and-Edge.ps1fails for every user with:The replacement map searched for
$domainSquattingEnabled = 1 #, but both templates ship the setting as= 0 #:Deploy-Windows-Chrome-and-Edge.ps1:25Detect-Windows-Chrome-and-Edge.ps1:34Apply-Replacementsmatches withString.Contains, so the lookup missed, the pattern was added to$missing, and the script threw before writing any output files. Nothing was produced for Intune.This was unrelated to the answers given at the prompts. The script's own prompt default for this setting is already
"0", so only the pattern literal was wrong.Fix
One line: the pattern now reads
$domainSquattingEnabled = 0 #, matching the templates.Verification
Deploy,Detect, andRemovetemplates fromrefs/heads/mainand checked all 23 replacement patterns against them. This was the only mismatch.Parser::ParseInput.O'Brien ITrenders as'O''Brien IT').Note for maintainers
Each pattern hardcodes the template's current default value, so any future change to a default will break setup with this same exception. Anchoring on
$varName =through to#would make the matching value-agnostic. Happy to follow up with that if you want it.🤖 Generated with Claude Code