v1.2.2 — English-language enforcement (OS + AD prerequisites) (#23) - #30
Conversation
Add docs/language-support.md describing the two fail-fast checks (English OS + English AD), the 18 fully-localized Windows Server languages matrix, the future -Language/community localization model, its challenges, and the closed-source history. Wire the page into the MkDocs nav, docs index, and README documentation list. Note the English OS + AD requirement in README Prerequisites, quick-deployment-guide, faq, and detailed-deployment-guide. Refs #23 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add an unconditional, fail-fast check to Test-TierModelPrerequisites that resolves three well-known groups by SID (Domain Admins <DomainSID>-512, Server Operators S-1-5-32-549, Account Operators S-1-5-32-548) and requires each directory Name to be its English value. Any mismatch stops Deploy/Audit up front with a friendly message. The check is child-domain safe (no Enterprise/Schema Admins), reads names from AD (never client-side SID translation), and is guarded to no-op when AD cannot be evaluated. Add 3 unit tests (non-English German fails, English passes, unresolved-AD no-op). Correct language-support docs to describe the OS check against the execution host (workstation or DC), not only the DC. Refs #23 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add an unconditional host-OS language gate to Test-TierModelPrerequisites, placed after the elevation check and before the Pester/module checks. It reads the local machine's static InstallLanguage LCID (HKLM\\...\\Nls\\Language) and accepts any English variant (primary language 0x09, e.g. en-US/en-GB); a non-English host fails fast and returns immediately so the operator is not asked to install modules on an unsupported OS. The check targets the host running the scripts (workstation or DC), not the remote DC, and is guarded to continue if the language cannot be read. Add 5 unit tests (German fails, early-return isolation, en-US passes, en-GB accepted, unreadable no-op) and default en-US (0409) mocks so the suite stays host-independent. Refs #23 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Isolate each well-known-group lookup in the AD language check with its own try/catch so a transient failure resolving one canary can no longer discard confirmed mismatches on the others (previously the shared try/catch could downgrade a genuinely non-English AD to a soft 'could not evaluate'). AdLanguageEnglish is now set true only when at least one canary resolves and none mismatch. Adds 2 unit tests (skip when domain SID is null; still fails closed when a later group throws mid-loop). Addresses a code-review observation. Refs #23 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump ModuleVersion to 1.2.2 and update the manifest ReleaseNotes and version-pin test. Add the CHANGELOG 1.2.2 entry documenting the fail-fast host-OS and Active Directory English-language checks. Refresh coverage docs: README test status (1,435 automated / 1,766 total, 88.72% docs-scope) and docs/test-coverage.md (Test-TierModelPrerequisites.ps1 396/468 = 84.62%, new code fully covered). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds fail-fast “English-only” enforcement to TierModel prerequisite validation so deployments/audits stop before making changes when the execution host OS or the Active Directory environment is not English, and updates docs/versioning accordingly.
Changes:
- Add host OS install-language (LCID) gate and AD well-known group-name gate to
Test-TierModelPrerequisites. - Add/adjust Pester unit + integration tests to cover the new language gates.
- Update documentation, changelog, and module version to v1.2.2, including a new Language Support page.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit.Prerequisites.Tests.ps1 | Adds unit coverage for host-OS + AD language gates (positive/negative/guarded cases). |
| tests/Unit.ModuleManifest.Tests.ps1 | Updates manifest version assertion to 1.2.2. |
| tests/Integration.WinLapsDeployment.Tests.ps1 | Mocks host OS install language to allow integration flow past new gate. |
| README.md | Adds Language Support link + updates version/test/coverage numbers and prereq note. |
| modules/TierModel/TierModel.psd1 | Bumps module version to 1.2.2 and updates ReleaseNotes. |
| modules/TierModel/public/Test-TierModelPrerequisites.ps1 | Implements host OS + AD English enforcement logic. |
| mkdocs.yml | Adds Language Support page to site navigation. |
| docs/test-coverage.md | Updates latest measurement summary and per-file coverage numbers for v1.2.2. |
| docs/quick-deployment-guide.md | Adds English-only prerequisite notes and references Language Support. |
| docs/language-support.md | New doc explaining English-only policy, enforcement design, and language matrix/roadmap. |
| docs/index.md | Adds Language Support under reference section. |
| docs/faq.md | Adds FAQ entry describing supported language behavior and links to Language Support. |
| docs/detailed-deployment-guide.md | Adds English-only environment note at top of guide. |
| CHANGELOG.md | Adds v1.2.2 release entry documenting new gates and doc updates. |
Suppressed comments (1)
modules/TierModel/public/Test-TierModelPrerequisites.ps1:465
- The AD language failure message says “English (en-US) Active Directory only”, but the check is really about English well-known group names (not a specific locale). Also, with the current logic a failure may be due to an unresolvable canary SID (unverifiable) rather than a localized name; the wording can be adjusted to cover both cases cleanly.
$null = $result.Errors.Add("Non-English Active Directory detected. The Tier Model supports English (en-US) Active Directory only.")
$null = $result.Remediation.Add("Run Deploy and Audit against an English (en-US) Active Directory. See Language Support: https://microsoft.github.io/ActiveDirectoryTierModel/language-support/")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $null = $result.Errors.Add("Non-English host operating system detected. The Tier Model supports English (en-US) Windows only.") | ||
| $null = $result.Remediation.Add("Run Deploy and Audit from an English (en-US) Windows host. See Language Support: https://microsoft.github.io/ActiveDirectoryTierModel/language-support/") |
| catch { | ||
| # A single well-known group could not be resolved; skip it so a | ||
| # transient failure cannot mask a confirmed mismatch on another. | ||
| continue | ||
| } |
…le.Tests (#23) Integration.Module.Tests.ps1 hard-asserts the loaded module version and was still pinned to 1.2.1, failing CI after the v1.2.2 bump (mirrors the Unit.ModuleManifest version-pin test already updated). Full suite now 1435/1435. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (3)
modules/TierModel/public/Test-TierModelPrerequisites.ps1:451
- The AD language gate currently
continues when a canary group lookup throws, which can allow a false pass when one or more of the three well-known groups cannot be resolved (contradicts the documented/PR-described “fail closed even if one group can’t be resolved”). Instead, record the failure as a mismatch so the check fails closed and preserves diagnostics.
catch {
# A single well-known group could not be resolved; skip it so a
# transient failure cannot mask a confirmed mismatch on another.
continue
}
modules/TierModel/public/Test-TierModelPrerequisites.ps1:157
- The host-OS language check allows any English primary language (0x09, e.g. en-US/en-GB), but the emitted error/remediation text says “en-US only”. This is misleading for operators on other English variants and contradicts the code comment right above.
$null = $result.Errors.Add("Non-English host operating system detected. The Tier Model supports English (en-US) Windows only.")
$null = $result.Remediation.Add("Run Deploy and Audit from an English (en-US) Windows host. See Language Support: https://microsoft.github.io/ActiveDirectoryTierModel/language-support/")
docs/language-support.md:3
- This page states “English (en-US) only”, but the implemented host OS gate accepts other English install-language variants (primary language 0x09), and the unit tests explicitly validate en-GB (0809) as a pass. The doc should reflect the actual rule (English primary language), or the code should be tightened to en-US only.
> **Status: English (`en-US`) only.** At this time the Active Directory Tier Model
Linked issue
Closes #23
What this PR does
Adds English-language enforcement so the Tier Model fails fast — before any deployment or audit change — when the environment is not English (
en-US). This is the documentation + guard-rail direction agreed on issue #23 (the alternative, full language-independent SID resolution in PR #18, is intentionally not taken here).Two unconditional checks are added to
Test-TierModelPrerequisitesand are inherited by bothDeploy-TierModel.ps1andAudit-TierModel.ps1:InstallLanguageLCID (HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language) and requires an English variant (primary language0x09, e.g. en-US/en-GB). Runs after the elevation check and before the Pester/module checks, and returns immediately on a non-English host so the operator is never asked to install modules on an unsupported OS.<DomainSID>-512, Server OperatorsS-1-5-32-549, Account OperatorsS-1-5-32-548) and requires each directoryNameto be its English value. Child-domain safe (no Enterprise/Schema Admins); names are read from AD (never client-side SID translation, which the local OS would localize into a false pass). Fails closed even if one well-known group cannot be resolved mid-check.Also included: new
docs/language-support.md(English-only rationale, the 18 fully-localized Windows Server languages that are detected/stopped, and a future community-localization roadmap), prerequisite notes across README + deployment guides + FAQ,CHANGELOGentry, and the v1.2.2 version bump.Security / tiering impact
en-US) deployments and audits are behaviorally unchanged (verified on a live English DC — see testing).Testing
.\tests\Invoke-AllTests.ps1— 1,435 / 1,435 passing, overall docs-scope coverage 88.72% (module scope ~91%, all above the 80% CI gate). New prerequisite code is fully covered (10 new unit tests).en-US):-FullDeploymentwith-IncludeMsa -IncludeGmsa -IncludeDmsa -IncludeWinLaps→ Applied 705, Errors 0; full audit (all features) → 100% compliant, 0 drift, 0 errors. Both logged "Prerequisites validation passed" (the new checks are transparent to a genuine English environment).Checklist
.\tests\Invoke-AllTests.ps1passes and coverage stays ≥ 80%