I have a function that is sometimes returning something totally different from what I would expect. Most of the time it returns True or False, but sometimes it is returning the utterly odd 32, ,0,True False.
The end of the function is
function Initialize-PxMachineContext {
...
Write-PxLog "W_$($InitProceed -and $ProcessSet)"
$InitProceed -and $ProcessSet
}
And that write to log is showing False. However, this is where the Return value gets used
$Ret = Initialize-PxMachineContext
Write-PxLog "W_$Ret"
if ($Ret) {...
The log shows this
** False
** 32, ,0,True False
The ** is a result of logging with the W(arning) prefix. The rest makes no sense to me. What is really odd is that when the return value is true, it all works file, but $False changes value en route. Just for fun I looked for $False = just in case, but I would assume $False is a constant that can't actually be changed without throwing it's own error. Nor did I find any instances of $False being assigned a new value. Anyone have any thoughts?
Gordon