From 9ccb746722b8fa8572f827ecb959fb99f1028f64 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Wed, 18 Dec 2024 19:28:02 +0200 Subject: [PATCH] Explicitly compare count of match Apparently on Windows PowerShell, 0 is not considered "false" but on PowerShell Core, it is... Signed-off-by: Gabriel Adrian Samfira --- powershell-yaml.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powershell-yaml.psm1 b/powershell-yaml.psm1 index 05389cf..80ce133 100644 --- a/powershell-yaml.psm1 +++ b/powershell-yaml.psm1 @@ -168,7 +168,7 @@ function Convert-ValueToProperType { } "tag:yaml.org,2002:float" { $parsedValue = 0.0 - if ($infinityRegex.Matches($Node.Value)) { + if ($infinityRegex.Matches($Node.Value).Count -gt 0) { $prefix = $Node.Value.Substring(0, 1) switch ($prefix) { "-" {