I have a script that asks for login ($ user) and password ($ password). Based on this, it executes a sql query with the result being a password ($ result)
$query = "select haslo from uzytkownicy where login='$user'" $result = Get-ODBC-Data -query $query if ($password -eq $result){ Write-Output "ok" } else { Write-Output "nok" }
My problem is that even if $ password is the same as $ result, I have a nok. I suppose the problem is that the result of the query is
(write-output $ result)
haslo
testowehaslo
( write-output $password )
testowehaslo
so there are 2 additional lines above the password. Can anyone tell me what I’m doing wrong?