From 36b34a0081c1384a8f78a58e45b9b98575f0a8eb Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Sun, 5 Nov 2023 14:48:13 +0100 Subject: [PATCH] fix bool switch --- public/Get-DbatoolsConfigValue.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/Get-DbatoolsConfigValue.ps1 b/public/Get-DbatoolsConfigValue.ps1 index 948e8b82d9..4d241c2f58 100644 --- a/public/Get-DbatoolsConfigValue.ps1 +++ b/public/Get-DbatoolsConfigValue.ps1 @@ -57,8 +57,8 @@ function Get-DbatoolsConfigValue { if ($null -eq $temp) { $temp = $Fallback } # Prevent some potential [switch] parse issues - if ($temp -eq "Mandatory") { $temp = $true } - if ($temp -eq "Optional") { $temp = $false } + if ($temp.ToString() -eq "Mandatory") { $temp = $true } + if ($temp.ToString() -eq "Optional") { $temp = $false } if ($NotNull -and ($null -eq $temp)) { Stop-Function -Message "No Configuration Value available for $Name" -EnableException $true -Category InvalidData -Target $FullName