← Files Power BI DesktopARCHIVED FILE
scripts/Test-PowerBIFabricSensitivityLabelCoverage.ps1
847 Bytes · Oct 2, 2026 · 00:32 UTC
param([string]$SnapshotDirectory,[string]$OutputPath,[switch]$Json)
$ErrorActionPreference='Stop'
. (Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) 'PowerBIFabricSnapshot.Shared.ps1')
$s=Get-FabricSnapshot -SnapshotDirectory $SnapshotDirectory -DefaultName 'security-exposure'
$missing=@($s.items|Where-Object{ -not $_.sensitivityLabel })
$findings=@($missing|ForEach-Object{New-FabricFinding High Sensitivity "$($_.name) has no sensitivity label."})
$result=[pscustomobject]@{schema='codex.powerbi.fabricSensitivityLabelCoverage.v1';title='Power BI Fabric Sensitivity Label Coverage';generated=(Get-Date).ToString('s');snapshotDirectory=$s.root;status=if($missing.Count){'CoverageGap'}else{'Covered'};missingLabelCount=$missing.Count;findings=$findings}
Write-FabricResult -Result $result -OutputPath $OutputPath -Json:$Json
SHA-256: cf09c67f50e3af45e0966a86cf3cce4d8b3e252895275dbb078426e0dc076f53