From 0a648d944e0ecab056d7a447fbfbdb35bd7e999c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:02:12 +0000 Subject: [PATCH 1/2] Initial plan From 6a0065da4585253ffe84a520546048e53d4e3e99 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:05:34 +0000 Subject: [PATCH 2/2] Extract AD ports to constant $AD_WELL_KNOWN_PORTS Co-authored-by: aahmed-spec <250927798+aahmed-spec@users.noreply.github.com> --- src/powershell/tests/Test-Assessment.25395.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/powershell/tests/Test-Assessment.25395.ps1 b/src/powershell/tests/Test-Assessment.25395.ps1 index 53fc74db8..6503b79bf 100644 --- a/src/powershell/tests/Test-Assessment.25395.ps1 +++ b/src/powershell/tests/Test-Assessment.25395.ps1 @@ -31,6 +31,9 @@ function Test-Assessment-25395 { [CmdletBinding()] param() + # Active Directory well-known ports + $AD_WELL_KNOWN_PORTS = @('53','88','135','389','445','464','636','3268','3269') + #region Helper Functions function Test-IsBroadCidr { @@ -98,11 +101,10 @@ function Test-Assessment-25395 { System.Boolean - True if port is a valid AD well-known port, false otherwise. #> param([string]$Port) - $valid = @('53','88','135','389','445','464','636','3268','3269') if ($Port -match '^(\d+)-(\d+)$') { - return ($matches[1] -eq $matches[2] -and $valid -contains $matches[1]) + return ($matches[1] -eq $matches[2] -and $AD_WELL_KNOWN_PORTS -contains $matches[1]) } - return ($valid -contains $Port) + return ($AD_WELL_KNOWN_PORTS -contains $Port) } #endregion Helper Functions