Skip to content
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.

The format follows [Conventional Commits](https://www.conventionalcommits.org/) and [Semantic Versioning](https://semver.org/): a new feature or capability bumps MINOR, a bug fix or performance change that leaves the public surface alone bumps PATCH, and docs/tests/chore-only commits don't bump. While the module is pre-1.0 a breaking change also bumps MINOR and is called out under a **Breaking Changes** heading — 1.0.0 is reserved for the point the public surface is declared stable, after which breaking changes bump MAJOR. There is intentionally no `[Unreleased]` section — every entry is dated at ship time.

## [1.1.0] - 2026-11-16

### Features

- **`Export-InforcerTenantDocumentation -Baseline` takes several baselines** and reads the tenant once. The policy list is the slow call (20 to 40 s on a large tenant) and every `-Baseline` call used to repeat it; a baseline's membership takes a fraction of a second. Without `-OutputPath` it returns one DocModel per baseline; with a directory it writes one `{TenantName}-{Baseline}-Documentation` file per baseline (a single baseline keeps the old `{TenantName}-Documentation` name; two baseline names that make the same file name get `-2`). A baseline that does not resolve is a `BaselineFilterFailed` error and the others are still exported. A file `-OutputPath` with several baselines is refused (`OutputPathIsFileForSeveralBaselines`). Measured on the inforcer Blueprint Library: 22 baselines in 48 s, previously about 34 minutes. Graph names (`-FetchGraphData`) and the Settings Catalog are resolved once for all of them.

### Bug Fixes

Found by reading every per-baseline document of the inforcer Blueprint Library.

- **Settings nested more than two objects deep rendered as empty rows.** Below two levels an object fell through to `ToString()`, which is empty for a `PSCustomObject`. Conditional Access device filter rules, guest and external user types and Entra's passkey migration opt-out showed nothing. The limit is now 10 and exists only to stop runaway recursion.
- **A setting stored as a dotted `@odata.type` was dropped.** Entra's device registration setting is `azureADRegistration.allowedToRegister.@odata.type = #microsoft.graph.allDeviceRegistrationMembership`, so "Users may register their devices" showed no setting. A dotted path ending in `@odata.type` is now rendered as that setting ("All Device Registration Membership"). Every other `@odata` key is still skipped.
- **List items showed only "N items".** An item without a display name or name was dropped, and the fields of named items were never shown, so an authentication method's Include Targets read "1 items" and nothing else. Each item now lists its fields ("Item 1", Target Type group, ID all_users). A single-field item is one row, and an id is never used as a label, so it stays a value that Graph resolution can reach. Objects, lists and encoded payloads inside an item render like any other setting, and an item's description is kept. A list and an item label with fields under it are headers, so `Compare-InforcerEnvironments` keeps them in the setting path. A field with the same value on every item of a list is shown once, under "All items", and a field that repeats the item's label is left out: Defender's custom indicators (492 Shadow AI domains) would otherwise repeat twelve identical fields per domain, about 8,400 rows for one policy, where it is now about 2,000. A field goes under "All items" only when every item has it with that value, and `Compare-InforcerEnvironments` keeps every item's own fields, so one changed item never moves the rest. A MAM app is one row again, labelled by its package id.
- **The HTML hid section headers.** With "hide empty" on (the default), a header row with no value was hidden like an empty setting, so the rows under it lost their context. Headers now stay visible.
- **Authentication strength combinations fell apart.** `allowedCombinations` items such as `password,softwareOath` were joined with commas and split again, giving "…, password, Software OATH Token, password, …". A list whose items contain a comma is now joined with `; `, and each combination reads "Password + Software OATH Token".

## [1.0.1] - 2026-11-16

### Bug Fixes
Expand Down
333 changes: 333 additions & 0 deletions Tests/Fix.DocReadability.Tests.ps1

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/CMDLET-REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ The HTML output features a modern admin dashboard design with a collapsible side
| **Show** | Switch | No | Open the generated HTML in the default browser, each file once per call (also when tenants are piped). Requires `-OutputPath` and `-Format Html`. **Defaults to on interactively, off in CI** (`CI`, `TF_BUILD`, `GITHUB_ACTIONS`, `GITLAB_CI`, `JENKINS_URL`, `TEAMCITY_VERSION`, `BUILDKITE`). `-Show` forces it, `-Show:$false` suppresses it; an explicit value always wins. |
| **SettingsCatalogPath** | String | No | Path to a local `settings.json` for Intune Settings Catalog name resolution. When omitted, the latest data is downloaded from the [IntuneSettingsCatalogData](https://github.com/royklo/IntuneSettingsCatalogData) GitHub release and cached at `~/.inforcercommunity/data/settings.json` (~65 MB). The cache is used as is for 24 hours; after that the module checks the release and downloads only when a newer catalog exists. A download replaces the cache only when it is a valid catalog of at most 512 MB. Offline, the cached copy is used, or raw setting IDs when there is none. |
| **FetchGraphData** | Switch | No | Signs in to Microsoft Graph interactively for the exported tenant (or reuses an existing Graph session for that tenant that already has the scopes), then resolves IDs to names: assignment groups and filters, scope tags, and the groups, directory roles, named locations and applications in Conditional Access policies. Requests `Directory.Read.All`, `Policy.Read.All` and `DeviceManagementConfiguration.Read.All`. Requires the `Microsoft.Graph.Authentication` module; without it, or when sign-in fails, raw IDs are kept with a warning. See [Graph integration](#graph-integration--fetchgraphdata). |
| **Baseline** | String | No | Filter to policies belonging to a specific baseline (name or ID). Policies are matched by id, by name only when there is no id. A same-named policy whose product, category or description differs is not used in its place, and one that still matches several is left out; both are named in a warning. A baseline that cannot be resolved or holds no policies is an error (`BaselineFilterFailed`) and nothing is exported. |
| **Baseline** | String[] | No | Filter to policies belonging to one or more baselines (names or IDs). Several baselines read the tenant once and produce one DocModel, or one `{TenantName}-{Baseline}-Documentation` file, per baseline. Policies are matched by id, by name only when there is no id. A same-named policy whose product, category or description differs is not used in its place, and one that still matches several is left out; both are named in a warning. A baseline that cannot be resolved or holds no policies is an error (`BaselineFilterFailed`); the other baselines are still exported. |
| **Tag** | String | No | Filter to policies with a specific inforcer tag (case-insensitive). |

### Examples
Expand Down
4 changes: 2 additions & 2 deletions module/InforcerCommunity.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'InforcerCommunity.psm1'
ModuleVersion = '1.0.1'
ModuleVersion = '1.1.0'
GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
Author = 'Roy Klooster'
Description = 'Community PowerShell module for the Inforcer API. Created by Roy Klooster. Not owned or officially maintained by Inforcer.'
Expand Down Expand Up @@ -38,7 +38,7 @@
PSData = @{
ProjectUri = 'https://github.com/royklo/InforcerCommunity'
LicenseUri = 'https://github.com/royklo/InforcerCommunity/blob/main/LICENSE'
ReleaseNotes = 'v1.0.1: Export-InforcerTenantDocumentation -Baseline documents exactly the baseline''s policies (same-named policies no longer leak in); a -Baseline that does not resolve or holds no policies is an error (BaselineFilterFailed) instead of exporting the whole tenant; name/value settings keep their values; -FetchGraphData reuses an app-only Graph session instead of opening a browser. See CHANGELOG.md.'
ReleaseNotes = 'v1.1.0: Export-InforcerTenantDocumentation -Baseline takes several baselines and reads the tenant once (22 baselines: 34 min -> 48 s). Documents now show settings nested more than two levels deep, list items with their fields, Entra settings stored as a dotted @odata.type, and authentication strength combinations intact. See CHANGELOG.md.''s policies (same-named policies no longer leak in); a -Baseline that does not resolve or holds no policies is an error (BaselineFilterFailed) instead of exporting the whole tenant; name/value settings keep their values; -FetchGraphData reuses an app-only Graph session instead of opening a browser. See CHANGELOG.md.'
Tags = @('Inforcer', 'API', 'Community')
}
}
Expand Down
13 changes: 11 additions & 2 deletions module/Private/ConvertTo-InforcerDocModel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function ConvertTo-InforcerDocModel {
}
} elseif ($null -ne $policy.policyData) {
# Non-catalog -- use ConvertTo-FlatSettingRows (per D-07)
foreach ($row in (ConvertTo-FlatSettingRows -PolicyData $policy.policyData)) {
foreach ($row in (ConvertTo-FlatSettingRows -PolicyData $policy.policyData -ComparisonMode:$ComparisonMode)) {
[void]$settings.Add($row)
}
}
Expand Down Expand Up @@ -419,7 +419,16 @@ function ConvertTo-InforcerDocModel {
$val = $row.Value
# Resolve camelCase values (e.g. allowedCombinations like "password,softwareOath")
$val = $row.Value
if (-not [string]::IsNullOrWhiteSpace($val) -and $val -is [string]) {
if ($name -eq 'Allowed Combinations' -and $val -is [string] -and $val.Contains(';')) {
# Only this setting: other values hold semicolons too (scripts, extension lists).
# A list whose items hold commas is joined with '; ' (ConvertTo-FlatSettingRows), so
# each item is one combination: "password,softwareOath" -> "Password + Software OATH Token".
$row.Value = @(foreach ($item in $val -split ';') {
$it = (($item -split ',') | ForEach-Object { $_.Trim() }) -join ','
if ($caFriendlyValues.ContainsKey($it)) { $caFriendlyValues[$it] }
else { @(foreach ($p in $it -split ',') { if ($caFriendlyValues.ContainsKey($p)) { $caFriendlyValues[$p] } else { $p } }) -join ' + ' }
}) -join '; '
} elseif (-not [string]::IsNullOrWhiteSpace($val) -and $val -is [string]) {
# Try full value first (handles combo keys like "password,microsoftAuthenticatorPush")
$trimmedVal = $val.Trim()
$normalizedVal = (($trimmedVal -split ',') | ForEach-Object { $_.Trim() }) -join ','
Expand Down
4 changes: 4 additions & 0 deletions module/Private/ConvertTo-InforcerHtml.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ tr:hover td { background: var(--row-hover); }
elseif ($trimmed -match '^\s*#!/') { $codeClass = 'sh-code'; $summaryClass = 'sh-code-summary'; $label = 'View script' }
else { $codeClass = 'ps-code'; $summaryClass = 'ps-code-summary'; $label = 'View script' }
$settingVal = "<details class=`"script-collapsible`"><summary class=`"$summaryClass`">$label</summary><pre class=`"$codeClass`">$encCode</pre></details>"
} elseif ($setting.IsConfigured -eq $false -and [string]::IsNullOrWhiteSpace("$($setting.Value)")) {
# A header: left blank rather than marked empty, so hide-empty keeps it visible
# and the rows under it keep their context.
$settingVal = ''
} else {
$settingVal = ConvertTo-SafeHtmlValue -Value $setting.Value -AllowMultiValue
}
Expand Down
Loading
Loading