Create C# dll and use method with powershell

后端 未结 1 648
Happy的楠姐
Happy的楠姐 2021-01-24 21:28

I created a simple C# dll and registered it using RegAsm.exe. One very simple method is invoked without parameters and returns a number, here is a simplified versio

1条回答
  •  遥遥无期
    2021-01-24 22:07

    Your method should be static or you need to create an instance of that type (TestClass).

    Last can be done using

    New-Object -TypeName  -ArgumentList 
    

    Or in your specific case:

    $test = New-Object -TypeName AVL_Test.TestClass
    $test.GetNumber()
    

    0 讨论(0)
提交回复
热议问题