title: How to export a class in a PowerShell v5 module
body: <p>I've got a module setup to be like a library for a few other scripts. I can't figure out how to get a class declaration into the script scope calling <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/import-module" rel="noreferrer"><code>Import-Module</code></a>. I tried to arrange <code>Export-Module</code> with a <code>-class</code> argument, like the <code>-function</code>, but there isn't a <code>-class</code> available. Do I just have to declare the class in every script?</p>
  <p>The setup:</p>
  <ul>
  <li>holidays.psm1 in ~\documents\windows\powershell\modules\holidays\</li>
  <li>active script calls <code>import-module holidays</code></li>
  <li>there is another function in holidays.psm1 that returns a class object correctly, but I don't know how to create new members of the class from the active script after importing</li>
  </ul>
  <p>Here is what the class looks like:</p>
  <pre><code>Class data_block
  {
      $array
      $rows
      $cols
      data_block($a, $r, $c)
      {
          $this.array = $a
          $this.rows = $r
          $this.cols = $c
      }
  }
  </code></pre>