All, trying to develop a simple function that does an evaluation and returns $true or $false, but the result always returns $false. What’s up with that? Am I doing something stupid here? The code works outside of the function.
$var = 'VDI'
function is_billable([String]$cb)
{
$list = [String]"'VDI','MOD','MDI'"
if($list -match $cb) {
$result =$true
}
else {
$result = $false
}
return $result
}
$test = is_billable($var)
- always comes back false