Skip to content

feat: Add Intune detection and setup scripts for Windows deployment#144

Merged
bmsimp merged 9 commits intoCyberDrain:devfrom
bmsimp:feat/intune-detection-setup
Apr 24, 2026
Merged

feat: Add Intune detection and setup scripts for Windows deployment#144
bmsimp merged 9 commits intoCyberDrain:devfrom
bmsimp:feat/intune-detection-setup

Conversation

@bmsimp
Copy link
Copy Markdown
Member

@bmsimp bmsimp commented Apr 10, 2026

Summary

  • Adds Detect-Windows-Chrome-and-Edge.ps1 -- an Intune detection script that verifies all registry keys written by the deploy script match expected configuration. Exits 0 (compliant) or 1 (drift detected), enabling Intune to automatically redeploy when settings change.
  • Adds Setup-Windows-Chrome-and-Edge.ps1 -- an interactive configurator that downloads the latest Deploy, Remove, and Detect scripts from GitHub, walks the user through each setting with defaults and validation, and outputs ready-to-upload scripts for Intune.
  • Updates domain-deployment.md with Intune-specific deployment instructions.

All config blocks mirror the existing Deploy-Windows-Chrome-and-Edge.ps1 variable names, grouping, and comment style for consistency across deployment methods.

Details

Detection script features:

  • Config block identical to the deploy script (same variables, same 0/1 convention, same inline comments)
  • Test-RegValue helper checks each registry property against expected values
  • Verifies both Chrome and Edge: core settings, domain squatting, custom branding, generic webhook (events + URL allowlist with exact count), extension settings, and conditional toolbar pin
  • Array subkeys (urlAllowlist, webhookEvents\events) verified bidirectionally -- checks count matches and no stale entries exist

Setup script features:

  • Downloads latest templates from GitHub with 30s timeout
  • Conditional prompts -- skips webhook URL/events when webhooks disabled, skips CIPP URL/tenant when CIPP reporting disabled
  • Input validation: 0/1 for booleans, 1-168 range for update interval, rejects double-quote characters in string fields
  • URL allowlist entered one at a time (not comma-separated)
  • Outputs configured scripts to a user-chosen directory

Copilot AI review requested due to automatic review settings April 10, 2026 20:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Windows Intune-focused tooling for deploying the Check browser extension by introducing a registry-based detection script, an interactive setup script that generates configured deploy/remove/detect scripts, and updating the Windows domain deployment documentation accordingly.

Changes:

  • Added an Intune detection script that validates Chrome/Edge policy registry keys against expected configuration.
  • Added an interactive setup script that downloads templates and generates configured Deploy/Remove/Detect scripts for upload to Intune.
  • Updated Windows domain deployment docs with Win32 app + detection-script guidance for Intune.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
enterprise/Setup-Windows-Chrome-and-Edge.ps1 Interactive generator that downloads template scripts and applies config replacements.
enterprise/Detect-Windows-Chrome-and-Edge.ps1 Intune detection script that checks registry policy keys/values for Chrome and Edge.
docs/deployment/chrome-edge-deployment-instructions/windows/domain-deployment.md Updated documentation to describe Intune Win32 app packaging, detection rules, and troubleshooting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread enterprise/Setup-Windows-Chrome-and-Edge.ps1
Comment thread enterprise/Setup-Windows-Chrome-and-Edge.ps1 Outdated
Comment thread enterprise/Setup-Windows-Chrome-and-Edge.ps1 Outdated
Comment thread enterprise/Detect-Windows-Chrome-and-Edge.ps1 Outdated
Comment thread enterprise/Detect-Windows-Chrome-and-Edge.ps1 Outdated
Comment thread docs/deployment/chrome-edge-deployment-instructions/windows/domain-deployment.md Outdated
Comment thread docs/deployment/chrome-edge-deployment-instructions/windows/domain-deployment.md Outdated
Comment thread docs/deployment/chrome-edge-deployment-instructions/windows/domain-deployment.md Outdated
bmsimp and others added 7 commits April 24, 2026 10:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com>
…main-deployment.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com>
…main-deployment.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com>
…main-deployment.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com>
…une Step 2

- Setup script: mirror the Format-ArrayLiteral change for scalar
  replacements by adding Format-SingleQuoted and switching all
  string-valued scalar replacements to single-quoted output.
  Prevents \$ / backtick interpolation in user-provided URLs and
  branding fields when generated scripts run.
- Docs: add the missing "Step 2: Create the Win32 App in Intune"
  between packaging and configuration, fixing the 1 -> 3 jump.
Deploy script previously only wrote the toolbar property when
$forceToolbarPin = 1. Flipping the setting from 1 to 0 left a stale
toolbar_pin=force_pinned / toolbar_state=force_shown on devices,
which Detect couldn't reliably catch without causing an infinite
redeploy loop.

Deploy: always write the toolbar property -- pinned values when =1,
default_unpinned / hidden when =0. Matches the CIPP Intune standard.

Detect: add ToolbarPinnedValue / ToolbarUnpinnedValue to the $browsers
array and always verify the toolbar property against the expected
value based on $forceToolbarPin.

Addresses Copilot review comment on toolbar pin drift.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread enterprise/Setup-Windows-Chrome-and-Edge.ps1 Outdated
Comment thread enterprise/Detect-Windows-Chrome-and-Edge.ps1 Outdated
Setup: Apply-Replacements now tracks which patterns were found and
throws a detailed error listing any missing patterns. Previously a
silent miss (e.g., upstream comment reworded) would produce an output
script stuck on defaults. Callers now pass -TemplateName so the error
identifies which template failed.

Detect: convert all remaining bare Test-RegValue calls and bare exit 1
paths to use Test-RegValueWithDetails / Write-DetectionFailure so every
failure mode emits a specific reason on stdout. Affects customBranding,
genericWebhook, genericWebhook/events (incl. count mismatch and
"unexpected events" branches), urlAllowlist (same), and
ExtensionSettings. Admins running the script manually now see exactly
which check failed.

Addresses Copilot review comments on silent replacement failures and
missing diagnostic output.
@bmsimp bmsimp merged commit da60ec9 into CyberDrain:dev Apr 24, 2026
1 check passed
@bmsimp bmsimp deleted the feat/intune-detection-setup branch April 24, 2026 16:00
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.

2 participants