From this answer to a similar question on DBA StackExchange:
Set-Location 'C:\Program Files\PostgreSQL\9.6\bin'
$env:PGPASSWORD = 'superPassword'
& .\psql.exe --% --username postgres --command "CREATE USER Ivan WITH CREATEDB PASSWORD 'ivanPassword';"
Note that the stop-parsing symbolstop-parsing symbol (--%) requires PowerShell v3 or newer.