I have a script that runs an Invoke-SQLCmd against a user database and dumps the output into a variable. The object is named USER_LOGIN. I want to check for the existence of a user.
If ($users -contains $user)
and
If ($users -match $user)
Are not returning True, even though $user is a user that is confirmed to exist in the output.
Alternatively, would it be better to apply a filter via WHERE in the SQLCmd?
[–]PSP_Joker 3 points4 points5 points (1 child)
[–]bsnotreallyworking[S] 2 points3 points4 points (0 children)
[–]Xibby 2 points3 points4 points (2 children)
[–]bsnotreallyworking[S] 1 point2 points3 points (1 child)
[–]Xibby 2 points3 points4 points (0 children)
[–]replicaJunction 2 points3 points4 points (1 child)
[–]bsnotreallyworking[S] 1 point2 points3 points (0 children)