Powershell db connection
Posted: Mon 27 Jul 2020 17:44
I'm trying to write a powershell script that uses dotconnect to connect to an Oracle db as a form of monitoring.
Powershell is relatively new to me, but I have a sql server script to base it off, the key part being:
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection;
$sqlConnection.ConnectionString = $ConnectionString;
$sqlConnection.Open();
For dotconnect, I was able to run the following...
Add-Type -Path "Devart.Data.Oracle.dll"
$testObj = New-Object Devart.Data.Oracle.OracleConnection;
$testObj.ConnectionString = "[Redacted]"
... but when I run $testObj.open(), I get the following message:
MethodInvocationException: Exception calling "Open" with "0" argument(s): "Method not found: 'System.String System.AppDomainSetup.get_LicenseFile()'."
How do I indicate to powershell that this is licensed? I couldn't find any documentation on running dotconnect within powershell.
Thanks!
Powershell is relatively new to me, but I have a sql server script to base it off, the key part being:
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection;
$sqlConnection.ConnectionString = $ConnectionString;
$sqlConnection.Open();
For dotconnect, I was able to run the following...
Add-Type -Path "Devart.Data.Oracle.dll"
$testObj = New-Object Devart.Data.Oracle.OracleConnection;
$testObj.ConnectionString = "[Redacted]"
... but when I run $testObj.open(), I get the following message:
MethodInvocationException: Exception calling "Open" with "0" argument(s): "Method not found: 'System.String System.AppDomainSetup.get_LicenseFile()'."
How do I indicate to powershell that this is licensed? I couldn't find any documentation on running dotconnect within powershell.
Thanks!