locked
The PowerShell script failed with below exception RRS feed

  • Question

  • Hi , I use oracle db and write a service with c# about query connections same that connection pool , recently work vbscript in mp and no problem but now wanted use this service in powershell code , i give below errors:

    The PowerShell script failed with below exception

    System.Management.Automation.CmdletInvocationException: Cannot find type [Oracle.ManagedDataAccess.Client.OracleConnection]: make sure the assembly containing this type is loaded.

    At line:31 char:18

    + $TCS = New-Object <<<<  Oracle.ManagedDataAccess.Client.OracleConnection...   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)

       at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

       at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)

       at System.Management.Automation.AssignmentStatementNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)

       at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)



    • Edited by Y_mrs Sunday, July 6, 2014 12:48 PM
    Saturday, June 28, 2014 10:19 AM

Answers

  • hello

    thanks my problem not resolved.

    I by pass problem with :2 powershell nested .

    Thanks

    • Marked as answer by Y_mrs Sunday, July 13, 2014 1:41 PM
    Sunday, July 13, 2014 1:41 PM

All replies

  • Hi,

    According to the error message, it seems like that the assembly that containing type Oracle.ManagedDataAccess.Client.OracleConnection is not loaded.

    Please first import the Oracle assembly, in addition, please also try to upgrade your .NET to 4.0 and above and check the reuslt.

    Please also go through the below link:http://docs.oracle.com/cd/E51173_01/win.122/e17732/intro003.htm

    Regards,

    Yan Li


    Regards, Yan Li

    Monday, June 30, 2014 6:58 AM
  • Hi Yan Li

    Thanks for response, My .Net version is 4.5.2.

    Is Oracle assembly a management pack?

    Thanks

    Tuesday, July 1, 2014 5:41 AM
  • Hi,

    I don't think so, Oracle assembly should be inmported when you run script which should use this assembly.

    Regards,

    Yan Li


    Regards, Yan Li

    Monday, July 7, 2014 2:15 AM
  • hello

    thanks my problem not resolved.

    I by pass problem with :2 powershell nested .

    Thanks

    • Marked as answer by Y_mrs Sunday, July 13, 2014 1:41 PM
    Sunday, July 13, 2014 1:41 PM