vendredi 26 août 2016

Greater-than PowerShell operator giving inaccurate results

For some reason, when I debug - $debug is equal to 1, yet when the debugger hits if(numUsers -gt 2), it enters the if block...

function numUsers()
    {@(query user /server:$server).Count - 1
    }

$debug = numUsers

if(numUsers -gt 2)
    {#true
    }
else
    {#Nothing
    }

Am I using the -gt operator properly? Am I missing something really obvious?

Appreciate any insight

Aucun commentaire:

Enregistrer un commentaire