Solution 1:

You can add the flag -o <DIR>. You could also use -f flag to override existing files while updating existing models with new fields.

The full command could be:

Scaffold-DbContext "Host=127.0.0.1;Database=dbname;Username=postgres;Password=test12345"Npgsql.EntityFrameworkCore.PostgreSQL -o Entities -f

Hope this helps