@Leo D'Arcy - Create script which accepts string as input as work around and see if it works.
For Example:
Param( [Parameter(Mandatory=$false,HelpMessage="Enter the value of what if ")] [String]$WhatIf = "False" ) if($WhatIf -eq "True"){ $NewWhatIf = $True }else{ $NewWhatIf = $False }
Write-Output $NewWhatIf.GetType()
Write-Output $NewWhatIf
Hope this information helps, please revert back if you have any further queries. Thank you.