functions/private/Confirm-IsBoolean.ps1
function Confirm-IsBoolean { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $name, [Parameter(Mandatory = $true)] [string] $type, $value ) $result = @{check = "IsBoolean"; name = $name; type = $type; value = $value} if ($value -isnot [boolean]) { $result.Add("errorFlag", 1) $result.Add("level", "Fatal") $result.Add("message", "You must specify a valid boolean value (ex: `$true or `$false) for the ""$name"" configuration.") } else { $result.Add("errorFlag", 0) } return (New-CheckResult @result) } |