PowerShell Live - being retired

Please go to http://www.shelltools.net for more information

Welcome to PowerShell Live - being retired Sign in | Join | Help
in
Home Main Site Blogs Forums Videos Chat Customer Support

Access Custom build .NET 2.0 Assembly

Last post 08-16-2007, 1:39 PM by turningweb. 1 replies.
Sort Posts: Previous
  • Access Custom build .NET 2.0 Assembly

     08-16-2007, 11:58 AM

    May I have some help on load and access a custom build .NET 2.0 Assembly using PowerScript?

                            FilePath:      C:\ps1\001\IS2008DllTest.dll

    AssemblyAndClassName:     IS2008DllTest.Test

    and how to call a function after the assembly (above) loaded ?

                            Function:      Initialize()

    Thanks advance !! 

     

     

  • Re: Access Custom build .NET 2.0 Assembly

     08-16-2007, 1:39 PM

    I have figured it out from other resources...

     Below is the working code. Hopefully, Someone else will find it useful.  :)

    #============================================================================
    # DOS command:
    #
    #      powershell -NoExit -nonInteractive c:\ps1\001\LoadDLL.ps1
    #
    #============================================================================

    [void][System.Reflection.Assembly]::LoadFile("C:\ps1\001\IS2008DllTest.dll");

    $objTest = new-object IS2008DllTest.Test;

    $objTest.Initialize();

     

View as RSS news feed in XML