scripts/Read-NSPEntraConnectState.ps1

<#
.SYNOPSIS
    Fixed Windows PowerShell entry point for the local read-only Entra Connect diagnostic.
.DESCRIPTION
    Reads only ADSync rules, connector identities and the anchor setting, through the same
    reviewed collector as remote diagnostics. Emits UTF-8 JSON on stdout; errors go to stderr.
    Accepts no script text, credentials, download location or executable command parameters.
#>

[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
try {
    . (Join-Path (Split-Path -Parent $PSScriptRoot) 'Private\Get-NSPEntraConnectReadScript.ps1')
    & (Get-NSPEntraConnectReadScript)
} catch {
    [Console]::Error.WriteLine($_.Exception.Message)
    exit 1
}