locked
Error connecting to HPRM from powershell RRS feed

  • Question

  • Hi There,

    I am trying to download files from HP records manager using document id.

    I have this working in a excel using macro. I am trying to develop powershell script so that I can automate this easily 

    can some one help me troubleshoot the below issue.

    is it because of any package required to import. if you have a working script please share there is no much help on google for this topic.

    thank you.

    kumar

    ----------------------------------------------

    Add-Type -Path "C:\Program Files (x86)\Hewlett-Packard\HP Records Manager\HP.HPTRIM.SDK.dll"

    $db = New-Object HP.HPTRIM.SDK.Database

    $db.Dispose()

    Results

    New-Object : Exception calling ".ctor" with "0" argument(s): "The type initializer for 'HP.HPTRIM.SDK.trimPINVOKE' threw an exception."
    At line:3 char:8
    +     $db = New-Object HP.HPTRIM.SDK.Database
    +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
     
    You cannot call a method on a null-valued expression.
    At line:5 char:5
    +     $db.Dispose()
    +     ~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

    Friday, September 13, 2019 8:38 PM

Answers

  • Hi There,

    the solution is: It is Driver issue. I was trying to execute from Powershell 64 BIT. When i execute it from 32 bit powershell the above error disappeared.

    Good luck

    kumar

    • Marked as answer by Kumar muppa Tuesday, November 5, 2019 3:25 AM
    Tuesday, November 5, 2019 3:25 AM

All replies

  • You will have to post in an HP forum for help with HP products.


    \_(ツ)_/

    Friday, September 13, 2019 9:20 PM
  • Hi There,

    the solution is: It is Driver issue. I was trying to execute from Powershell 64 BIT. When i execute it from 32 bit powershell the above error disappeared.

    Good luck

    kumar

    • Marked as answer by Kumar muppa Tuesday, November 5, 2019 3:25 AM
    Tuesday, November 5, 2019 3:25 AM