Invoke-SQLCmd output

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) 


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?

submitted by /u/bsnotreallyworking
[link] [comments]

Leave a Reply