From 966aa21a461d5bb41f22f418a92f4489ec863246 Mon Sep 17 00:00:00 2001 From: Shirofune-Security <43838376+Shirofune-Security@users.noreply.github.com> Date: Sat, 19 Sep 2026 04:40:13 +0900 Subject: [PATCH] Enumerate corpus rules explicitly in PowerShell 5.1 fixtures --- tests/NativeProviders.Tests.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/NativeProviders.Tests.ps1 b/tests/NativeProviders.Tests.ps1 index 69b4750a..6683eba3 100644 --- a/tests/NativeProviders.Tests.ps1 +++ b/tests/NativeProviders.Tests.ps1 @@ -85,8 +85,9 @@ $script:SecurityRulesPath = Join-Path $script:ScriptRoot 'rules.json' try { # Exercise the real corpus's rule-side wildcard against the exact catalog # selectors, through the public CSV/JSON/HTML assessment path. - $wildcardRules = @(Get-Content -LiteralPath (Join-Path $PSScriptRoot '../config/security_rules.json') -Raw | - ConvertFrom-Json | Where-Object { $_.channel -contains 'Microsoft-Windows-Security-Mitigations*' }) + $corpus = Get-Content -LiteralPath (Join-Path $PSScriptRoot '../config/security_rules.json') -Raw | ConvertFrom-Json + # Explicitly enumerate the parsed array on Windows PowerShell 5.1 as well. + $wildcardRules = @($corpus | Where-Object { $_.channel -contains 'Microsoft-Windows-Security-Mitigations*' }) Assert-Equal ($wildcardRules.Count -gt 0) $true 'Real Security-Mitigations wildcard rules are present' $fixtures = @( @{ id = 'application'; channel = @('Application') }