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) { "-" {