title: Cmdlet in C# binary not exporting when imported with Import-Module
body: <p>I am attempting to create an interface for one of my C# programs by creating a PowerShell Cmdlet. I originally created the project (in visual studio) as a <code>Console Application</code>. I have switched the Output type to <code>Class Library</code> in the project properties and commented out the main class. Then I added a <code>Cmdlet</code> class in the same namespace.</p>
  <pre class="lang-cs prettyprint-override"><code>using System.Management.Automation;
  // various other using dependencies
  
  namespace MyProgram
  {
      // This class used to contain the main function
      class ProgramLib
      {
          // various static methods
      }
  
      [Cmdlet(VerbsCommon.Get, &quot;ProgramOutput&quot;)]
      [OutputType(typeof(DataTable))]
      class GetProgramOutputCmdlet : Cmdlet
      {
          protected override void ProcessRecord()
          {
              // Code using ProgramLib methods
          }
  
          // Begin/End Processing omitted for brevity
      }
  }
  </code></pre>
  <p>The project will build successfully and output a <code>.dll</code> file named <code>MyProgram.dll</code>.</p>
  <p>I can then navigate to the project directory via PowerShell and import the assembly with no errors:</p>
  <pre class="lang-none prettyprint-override"><code>PS&gt; Import-Module .\MyProgram.dll -Verbose -Force
  VERBOSE: Loading module from path 'C:\my\current\path\MyProgram.dll'.
  PS&gt; 
  </code></pre>
  <p>However, it does not appear to load my Cmdlet:</p>
  <pre class="lang-none prettyprint-override"><code>PS&gt; Get-ProgramOutput
  Get-ProgramOutput : The term 'Get-ProgramOutput' is not recognized as the name of a
  cmdlet, function, script file, or operable program.
  </code></pre>
  <p>Why isn't my Cmdlet exporting?</p>
  <p>I have included both the <code>System.Management.Automation</code> and <code>Microsoft.PowerShell.5.ReferenceAssemblies</code> references in my project; the ladder via NuGet.</p>