From da7345a198b8d4d6ab1b1c9aaa0daaec4105a797 Mon Sep 17 00:00:00 2001 From: Viktor Prutyanov Date: Wed, 14 Jul 2021 17:35:51 -0700 Subject: [PATCH] Fix comparisons in Test-NumericParameterMaxValue Make comparison of parameter max values numeric, not string. It fixes erroneous fail when JumboPacket max value is 65500: [FAIL] *JumboPacket NumericParameterMaxValue is -ge 9014 Now it behaves correctly: [PASS] *JumboPacket NumericParameterMaxValue is -ge 9014 Signed-off-by: Viktor Prutyanov --- internal/helpers.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/helpers.psm1 b/internal/helpers.psm1 index 6bde8e6..ebde259 100644 --- a/internal/helpers.psm1 +++ b/internal/helpers.psm1 @@ -400,7 +400,7 @@ Function Test-NumericParameterMaxValue { ) if ($OrGreater) { - if ($AdvancedRegistryKey.NumericParameterMaxValue -ge $DefinitionPath.NumericParameterMaxValue) { + if ([int] $AdvancedRegistryKey.NumericParameterMaxValue -ge [int] $DefinitionPath.NumericParameterMaxValue) { Write-WTTLogMessage "[$PASS] $($AdvancedRegistryKey.RegistryKeyword) NumericParameterMaxValue is -ge $($DefinitionPath.NumericParameterMaxValue)" "[$PASS] $($AdvancedRegistryKey.RegistryKeyword) NumericParameterMaxValue is -ge $($DefinitionPath.NumericParameterMaxValue)" | Out-File -FilePath $Log -Append } @@ -412,7 +412,7 @@ Function Test-NumericParameterMaxValue { } } else { - if ($AdvancedRegistryKey.NumericParameterMaxValue -eq $DefinitionPath.NumericParameterMaxValue) { + if ([int] $AdvancedRegistryKey.NumericParameterMaxValue -eq [int] $DefinitionPath.NumericParameterMaxValue) { Write-WTTLogMessage "[$PASS] $($AdvancedRegistryKey.RegistryKeyword) NumericParameterMaxValue is $($DefinitionPath.NumericParameterMaxValue)" "[$PASS] $($AdvancedRegistryKey.RegistryKeyword) NumericParameterMaxValue is $($DefinitionPath.NumericParameterMaxValue)" | Out-File -FilePath $Log -Append }