परामर्श करें:https://odbc.postgresql.org/
डाउनलोड करें:https://www.postgresql.org/ftp/odbc/versions/msi/
विंडोज़ पर डेटा स्रोत (ओडीबीसी):प्रारंभ → खोज → ओडीबीसी → उपयोगकर्ता डीएसएन → जोड़ें/कॉन्फ़िगर करें
उदाहरण:
$MyServer = "<ip>"
$MyPort = "5432"
$MyDB = "<database>"
$MyUid = "<user>"
$MyPass = "<pass>"
$DBConnectionString = "Driver={PostgreSQL UNICODE(x64)};Server=$MyServer;Port=$MyPort;Database=$MyDB;Uid=$MyUid;Pwd=$MyPass;"
$DBConn = New-Object System.Data.Odbc.OdbcConnection;
$DBConn.ConnectionString = $DBConnectionString;
$DBConn.Open();
$DBCmd = $DBConn.CreateCommand();
$DBCmd.CommandText = "SELECT * FROM tb_module;";
$DBCmd.ExecuteReader();
$DBConn.Close();