AzStackHci.DiagnosticSettings
0.6.7
Microsoft Azure Local - Diagnostics settings and connectivity tests support module
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
(c) 2026 Microsoft Corporation. All rights reserved.
Package Details
Author(s)
- Microsoft Corporation
Tags
Microsoft AzStackHci Diagnostic Settings Connectivity AzureLocal
Functions
Get-AzStackHciMemoryDumpSettings Set-AzStackHciMemoryDumpSettings Restore-AzStackHciMemoryDumpSettings Get-AzStackHciPageFileSettings Restore-AzStackHciPageFileSettings Set-AzStackHciPageFileSettings Set-AzStackHciPageFileSettingsMinimal Get-AzStackHciUserModeCrashDumpSettings Set-AzStackHciUserModeCrashDumpSettings Restore-AzStackHciUserModeCrashDumpSettings Test-AzStackHciSSLInspection Send-ClusterPerformanceHistory Test-AzureLocalConnectivity Test-Layer7Connectivity Test-TCPConnectivity Get-AzStackHciOsConfigSettings Test-ArcMachinePrivateLinkScopeEnabled
PSEditions
Dependencies
This module has no dependencies.
Release Notes
## v0.6.7
Three headline features for Test-AzureLocalConnectivity: HEAD-method optimisation (-RequestMethod), process-isolated parallel fan-out (-Parallelism), and cluster-wide fan-out (-Scope Cluster). Defaults preserve pre-0.6.7 output except -RequestMethod, which defaults to Auto (HEAD with GET fallback — see below).
### Test-AzureLocalConnectivity — -ExportPath always copies to ProgramData
- Results are ALWAYS written to C:\ProgramData\AzStackHci.DiagnosticSettings. A custom -ExportPath is now an ADDITIONAL copy target — the run folder is also copied there (never instead of ProgramData). Copy is best-effort (warns on failure, never aborts). Default unchanged (ProgramData only). Centralized as $script:DEFAULT_DIAG_EXPORT_PATH.
- -ExportPath is validated up front: empty / UNC (\\server\share) / relative / invalid-char paths are rejected; a valid absolute local path that does not yet exist is accepted and created at copy time.
### Test-AzureLocalConnectivity — proxy configuration on -PassThru + JSON
- -PassThru and the JSON summary now expose ProxyEnabled (bool), ProxyServer (raw netsh winhttp string, null when no proxy), ProxyHttp and ProxyHttps. For the Arc Gateway scenario (http=customerproxy:8080;https=localhost:40343) Get-Proxy parses the two schemes into ProxyHttp/ProxyHttps so callers can confirm both without parsing the transcript. All null when no proxy / a single un-prefixed proxy is set (ProxyServer still holds the raw value).
### Test-AzureLocalConnectivity — new -Scope Cluster cluster-wide fan-out
- New parameter -Scope <Node|Cluster> default 'Node'. -Scope Cluster enumerates Get-ClusterNode (UP only) and runs the node-scope test on every node in parallel via Invoke-Command, merging per-node results into a single cluster-shaped pscustomobject.
- New tabbed HTML cluster report (Status Overview + per-node tabs) with companion JSON sidecar (schema 'AzStackHciClusterConnectivity/v1') containing the full cluster bundle and per-node rows so consumers can recover everything the HTML shows.
- New per-node download speed + run telemetry: the fan-out scriptblock re-emits each node result as a pscustomobject so the scalar telemetry survives Invoke-Command serialization (container NoteProperties are otherwise stripped). Exposed as NodeDownloadSpeeds[<node>] and NodeTelemetry[<node>] on the cluster result, a Download Speed column in the HTML Status Overview, and in the JSON sidecar.
- New row field 'MachineName' = $env:COMPUTERNAME on every result row. Additive — existing parsers see one new column / property and continue to work.
- Cluster fan-out uses standard Kerberos / Invoke-Command (NO CredSSP / WinRM / TrustedHosts changes — operator must run with valid credentials). Per-node sweeps run in parallel (one lightweight Start-Job per node); each node runs its own local sweep at per-node -Parallelism 8 by default (override with -Parallelism).
- Strict exact-version pre-flight: every node is checked for the orchestrator's EXACT module version before any test runs. A missing/drifted node is a graceful, blocking failure (lists node(s), returns $null) so a report never blends mixed versions. Fan-out import pinned via -RequiredVersion (was plain -Force).
- New opt-in switch -InstallMissingModuleOnNodes (only with -Scope Cluster): side-loads the orchestrator's exact version to missing/drifted nodes by copying its module folder over a PSSession (Copy-Item -ToSession) — air-gap friendly (no PSGallery / internet). Opt-in by design (no silent node mutation; no CredSSP / WinRM / TrustedHosts changes). The pre-flight failure suggests re-running with this switch; using it without -Scope Cluster emits a Write-Warning.
- Send-DiagnosticData / Invoke-UploadDiagnosticResults integration for the cluster bundle when -ExcludeUploadResults is not set.
### Test-AzureLocalConnectivity — new -Parallelism parameter (Start-Job fan-out)
- New parameter -Parallelism <int> [ValidateRange(1,16)], default 1. At 1 the Layer-7 endpoint loop is byte-identical to pre-0.6.7. At 2..16 the endpoint list is partitioned into N buckets and each bucket is dispatched to a Start-Job process-isolated worker; the parent waits for all workers and merges by RowID. Start-Job (not ForEach -Parallel) so PS 5.1 Desktop is supported and per-worker mutation of ServicePointManager statics is isolated.
- Cost-aware bin-pack: rows scored by Get-Layer7RowCost (CRL/OCSP/Critical=3, Wildcard/Redirect=2, default=1) and assigned greedily to the cheapest bucket, avoiding one bucket getting all the slow CRL endpoints. -RoundRobin preserves the legacy modulo-N distribution.
- Worker contract: each job imports the module fresh, seeds module-scope state from the parent snapshot, runs its bucket, then snapshots classification state (SSLInspectedURLs, CRLOfflineURLs, SSLInspectionDetected, PrivateLink* arrays) + new CRL/OCSP rows. Parent merge replaces rows by RowID, dedupes CRL/OCSP by URL+Port, unions classification arrays, ORs the SSL-inspection flag.
- [bucket-N] log prefix: workers tag every Write-HostAzS line with their bucket index so the parent transcript shows '[bucket-3] Testing https://...' instead of un-attributed lines.
- Start-Job names zero-pad the bucket index so worker output replays in numeric bucket order for -Parallelism >= 11 (cosmetic; output is RowID-sorted at merge).
- Reliability: try/finally Stops + Removes every job on exit (per-run GUID tag). Per-bucket Wait-Job timeout scales with bucket size; laggard buckets are Stop-Job-ed and their unfinished endpoints picked up by the remaining-URLs loop. Per-row try/catch means one failed endpoint never aborts a bucket.
- New JSON top-level fields: Layer7WallClockSeconds (perceived L7-phase elapsed — the parallel-scaling metric; Layer7TotalDurationSeconds keeps "sum of per-endpoint times") and Parallelism. -PassThru exposes both as NoteProperties.
- Output ordering identical to sequential (Publish-Results sorts by RowID), so the diff between -Parallelism 1 and 8 is limited to transient network state plus the new top-level fields.
- Wildcard subdomain probes run concurrently with the L7 sweep when -Parallelism > 1: a dedicated Start-Job worker runs Test-ManuallyDefinedSubdomains and merges new subdomain rows + wildcard Notes after the L7 merge (~10-15 s saved), falling back to inline sequential if it times out/throws. New JSON field WildcardWorkerWallClockSec (0 sequential); -Parallelism 1 unchanged.
- Latent bug fixed: Invoke-EndpointConnectivityTest didn't forward -RequestMethod, so it was silently ignored on the wildcard-expansion / redirect-retry / remaining-URLs paths. Fixed.
### Bug fixes / hygiene (v0.6.7)
- Removed dead Resolve-Layer7Redirect helper (unused; would have polluted $script:RedirectedResults with raw strings).
- New private Get-LoadedModuleVersion helper handles the case where Get-Module returns multiple entries for nested-module loads.
- New PSScriptAnalyzerSettings.psd1 at module root (0 findings).
- New Unit-Tests\Run-PesterWithCoverage.ps1: Pester 5.x + JaCoCo coverage XML for CI / dashboards.
- Final-review fix: Publish-Results' Select-Object projection was dropping the new MachineName column from HTML / CSV / JSON / -PassThru. Now preserved (appended at end).
- Final-review fix: cluster orchestrator distinguishes WinRM remoting failures from genuinely missing modules so users get actionable guidance for each.
### Test-AzureLocalConnectivity / Test-Layer7Connectivity — HEAD-method optimisation (DEFAULT CHANGED)
- New -RequestMethod parameter on both functions: 'Auto' (NEW DEFAULT — HEAD first, GET fallback on 405/400 or an ambiguous 403), 'Get' (legacy GET-only, opt in for byte-identical pre-0.6.7 output), or 'Head' (HEAD only, no fallback).
- Behaviour change: the default is now Auto. HEAD skips the response-body download on every test; the Auto fallback re-issues GET on 405/400 or an ambiguous (body-less) 403 (first request only, once per URL, before timeout-retry, so HEAD-incompatible endpoints never consume the retry budget). Cert-chain capture, redirect handling, status interpretation, and SSL/CRL classification are unchanged on the GET retry.
- Measured impact (n=11, WestEurope, 81 endpoints): Layer7-sum mean saving ~2.9 s (~3-4%), faster in 7/11 runs. Larger endpoint sets see proportionally larger savings.
- Opt out for byte-identical pre-0.6.7 behaviour: -RequestMethod Get.
### Test-AzureLocalConnectivity — run-timing telemetry
- New JSON fields: RequestMethod, Parallelism, TotalDurationSeconds, Layer7TotalDurationSeconds (sum), Layer7WallClockSeconds (perceived), Layer7TestedEndpoints — enables A/B comparison from one JSON file, also exposed via -PassThru NoteProperties. End-of-run console/transcript line summarises all of them.
### Reliability
- Invoke-WebRequest DNS-failure retry: on NameResolutionFailure, Test-Layer7Connectivity retries up to 3 times (1 s pause) before the HEAD->GET fallback and timeout-retry — catches transient resolver / proxy / IPv6-race flakes the DNS pre-check loop misses.
- Test-AzureLocalConnectivity and Get-AzStackHciOsConfigSettings now also Write-Error (in addition to Write-HostAzS) on elevation failure so -NoOutput callers see the failure. Get-AzStackHciOsConfigSettings additionally gains an explicit Test-Elevation pre-check.
### Helper scripts
- New Helpers\Compare-ParallelismPerformance.ps1 and Helpers\Compare-RequestMethodPerformance.ps1 A/B benchmarking scripts for -Parallelism (Layer7Speedup + efficiency) and -RequestMethod (WallClock/Layer7 savings).
For full version history (including v0.6.6 and earlier) see CHANGELOG.md shipped with this module.
FileList
- AzStackHci.DiagnosticSettings.nuspec
- CHANGELOG.md
- GitHub-URI-Cache_2026-07-07\AustraliaEast-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\IndiaCentral-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\southeastasia-hci-endpoints.md
- Private\AzStackHci.Connectivity.Helpers.ps1
- Private\AzStackHci.DNS.Helpers.ps1
- Private\AzStackHci.MemoryDump.Helpers.ps1
- Private\AzStackHci.OsConfigReport.Helpers.ps1
- Private\AzStackHci.Utility.Helpers.ps1
- Public\AzStackHci.ConnectivityTests.ps1
- Public\AzStackHci.OsConfigSettings.ps1
- Public\AzStackHci.PrivateLinkScope.ps1
- Public\AzStackHci.UserModeCrashDumpSettings.ps1
- GitHub-URI-Cache_2026-07-07\OEMEndpoints\DellAzureLocalEndpoints.md
- GitHub-URI-Cache_2026-07-07\OEMEndpoints\HPEAzureLocalEndpoints.md
- AzStackHci.DiagnosticSettings.psd1
- PSScriptAnalyzerSettings.psd1
- GitHub-URI-Cache_2026-07-07\canadacentral-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\japaneast-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\usgovvirginia-hci-endpoints.md
- Private\AzStackHci.ConnectivityCluster.Helpers.ps1
- Private\AzStackHci.HardwareOEM.Helpers.ps1
- Private\AzStackHci.ModuleManagement.Helpers.ps1
- Private\AzStackHci.ParallelLayer7.Helpers.ps1
- Private\AzStackHci.WildcardAndSubdomain.Helpers.ps1
- Public\AzStackHci.MemoryDumpSettings.ps1
- Public\AzStackHci.PageFileSettings.ps1
- Public\AzStackHci.SSLInspection.ps1
- GitHub-URI-Cache_2026-07-07\OEMEndpoints\DataOnAzureLocalEndpoints.md
- GitHub-URI-Cache_2026-07-07\OEMEndpoints\HitachiAzureLocalEndpoints.md
- GitHub-URI-Cache_2026-07-07\OEMEndpoints\LenovoAzureLocalEndpoints.md
- AzStackHci.DiagnosticSettings.psm1
- README.md
- GitHub-URI-Cache_2026-07-07\eastus-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\southcentralus-hci-endpoints.md
- GitHub-URI-Cache_2026-07-07\westeurope-hci-endpoints.md
- Private\AzStackHci.Constants.ps1
- Private\AzStackHci.Layer7.Helpers.ps1
- Private\AzStackHci.Network.Helpers.ps1
- Private\AzStackHci.Results.Helpers.ps1
- Public\AzStackHci.ClusterPerformance.ps1
- .signature.p7s