I use on Windows Server 2019 scheduled job as
powershell & \'C:\\Program Files\\PostgreSQL\\12.3-7.1C\\bin\\pg_dump.exe\' basename > bn.bak