The pg_ctl stall issue has been fixed.
I am now trying to work around the Powershell streams. It seems psql writes
all its output including info, debug to error stream whereas Powershell has
a different stream for each of errors, warnings, debug and info. I have
been able to redirect all the output to stdout instead. However, this
redirects errors as well without failing the build. I am thinking of
manually processing the output to catch errors and manually terminate the
build in such a case. However, I think there might be a simpler solution to
use psql in quiet mode. What are your views on this ?