How to prevent asking for password when creating new database in PostgreSQL 10?
use the PGPASSWORD environment variable, 

@SET PGPASSWORD=something_secret
psql -c "CREATE DATABASE mydb" -U postgres postgres


or just use a connection string

psql -c "CREATE DATABASE mydb" "user=postgres dbname=postgres password=something_secret"