title: powershell copy data from csv to postgres
body: <p>hitting an issue where you hopefully can help me with:
  I want to import a csv file to postgres with powershell. For this have written following code:</p>
  <pre><code>$ConnectionString = &quot;Driver={PostgreSQL UNICODE(x64)};Server=$SQLServer;Port=$SLQPort;Database=$SQLDB;Uid=$SQLUser;Pwd=$SQLPass;&quot;
  $connection = New-Object System.Data.ODBC.ODBCConnection
  $connection.ConnectionString = $ConnectionString
  
  $connection.Open()
  
  $query= &quot;copy sensorhistory from 'C:\Powershell_Scripts\Postgres\Eurogate\data\export.csv' Delimiter ',' csv header;&quot;
  
  $DBCmd = $connection.CreateCommand();
  $DBCmd.CommandText   = $query
  $DBCmd.ExecuteNonQuery() | Out-Null
  $DBCmd.ExecuteReader();
  </code></pre>
  <p>But I am getting the error &quot;No such file or directory&quot;
  the link is correct and already made changes to allow access to everybody, but still not working.
  Any help is welcome</p>