Search notes:

System.Data.OleDb (namespace)

System.Data.OleDb is the namespace for the .NET namespace for the Data Provider for OLE DB.
This namespace does not support OLE DB version 2.5 interfaces.
It also does not support the Microsoft's OLE DB provider for ODBC (MSDASQL). Instead, System.Data.Odbc should be used.

TODO

Using System.Data.OleDb to execute a DDL statement that is stored in a file:
$con = new-object System.Data.OleDb.OleDbConnection
$con.ConnectionString = "Provider=OraOLEDB.Oracle;User Id=[DWH_USER];Data Source=TEST1.RENE.XYZ;OSAuthent=1"
$con.Open()

$sqlStatement = [IO.File]::ReadAllText("$pwd\ddl.sql", [System.Text.Encoding]::GetEncoding(1252))

$cmd = $con.CreateCommand();
$cmd.CommandText = $sqlStatement
$cmd.ExecuteNonQuery();

Index