title: Create C# dll and use method with powershell
body: <p>I created a simple C# dll and registered it using <code>RegAsm.exe</code>. One very simple method is invoked without parameters and returns a number, here is a simplified version. </p>
  
  <pre><code>namespace AVL_test {
      interface ITestClass {
          int GetNumber();
      }
  
      [ComVisible(true)]
      public class TestClass: ITestClass {
          public TestClass() { }
  
          public int GetNumber() {
              return 10;
          }
      }
  }
  </code></pre>
  
  <p>I need to invoke that method from Powershell, so I added the type</p>
  
  <pre><code>Add-Type -Path "C:\myPath\AVL_test.dll"
  </code></pre>
  
  <p>It seems to be loaded because if I <code>[AVL_test.TestClass]</code> I get this output</p>
  
  <blockquote>
    <p>IsPublic IsSerial Name                                     BaseType<br>
    -------- -------- ----                                     --------<br>
    True     False    TestClass                                System.Object     </p>
  </blockquote>
  
  <p>But if I try to invoke <code>GetNumber()</code> by typing<code>[AVL_test.TestClass]::GetNumber()</code> I get this error</p>
  
  <blockquote>
    <p>Method invocation failed because [AVL_test.TestClass] does not contain a method named 'GetNumber'.</p>
  </blockquote>
  
  <p>Am I doing something wrong?</p>