powershell -Or operator not working

Try

If ($User -match "administrator" -or $User -match "kahuna")

Your -or operator doesn’t tie the values of the previous operator together. You need to specify a 2nd conditional operator after -or I believe.

Leave a Comment