how to call my dll and use it in powershell script

c#, powershell

Solution

Your class has got constructors (at least one). So create the object with the good params

$MyCompObj = New-Object MyClass.Student -argumentlist "arg1","Arg2" ...

Problem

I have my own `dll` which written in c#. Now I want to call that from my `powershell` script. I did the following; ``` [System.Reflection.Assembly]::LoadFile("E:\MyClass.dll") $MyCompObj = New-Object MyClass.Student ``` But when I executing that, it giving me error Constructor not found. Cannot find an appropriate constructor for type MyClass.Student Am I following a wrong way to do this?? Please help me to fix this.

Original source