From 2ec8f928236807b3392df620bc9e5a4a5016aa0d Mon Sep 17 00:00:00 2001 From: Matt Frey Date: Thu, 25 Nov 2021 06:34:40 -0600 Subject: [PATCH] Address Issue 496 (#497) Addressing Issue 496 to resolve the unintentional false condition when `-Value` is set to `$false` on `Set-HVGlobalSettings Signed-off-by: Matt Frey --- Modules/VMware.Hv.Helper/VMware.HV.Helper.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/VMware.Hv.Helper/VMware.HV.Helper.psm1 b/Modules/VMware.Hv.Helper/VMware.HV.Helper.psm1 index 254419a..0acacd7 100644 --- a/Modules/VMware.Hv.Helper/VMware.HV.Helper.psm1 +++ b/Modules/VMware.Hv.Helper/VMware.HV.Helper.psm1 @@ -10278,7 +10278,7 @@ function Set-HVGlobalSettings { process { $updates = @() - if ($key -and $value) { + if ( $PSBoundParameters.ContainsKey('Key') -and $PSBoundParameters.ContainsKey('Value') ) { $updates += Get-MapEntry -key $key -value $value } elseif ($key -or $value) { Write-Error "Both key:[$key] and value:[$value] needs to be specified"