title: Export and then Import customized WMI Namespace
body: <p>Trying to export a customized WMI Namespace:</p>
  
  <p>I know it is easy to query and use:</p>
  
  <pre>
  ROOT\CIMV2
  </pre>
  
  <p>Have a need to export the entire customized Namespace: </p>
  
  <pre>
  ROOT\CustomName
  </pre>
  
  <p>and then import on another computer.</p>
  
  <p>Did find:
  <a href="https://stackoverflow.com/a/5363099/175063">https://stackoverflow.com/a/5363099/175063</a></p>
  
  <p>I have tried the following in PowerShell:</p>
  
  <pre><code>Get-WMIObject -namespace "root" -class "__Namespace" | Select Name
  </code></pre>
  
  <p>But, now I need to export "CustomName" and it's class structure.</p>
  
  <p>I am getting closer on this - testing (note: CIMV2, as I want to check for an export from known, good namespace. I will replace with CustomName later).</p>
  
  <p><a href="https://stackoverflow.com/a/32258127/175063">https://stackoverflow.com/a/32258127/175063</a></p>
  
  <pre><code>(GWMI -Namespace "root\CIMV2" -List).GetText('mof') |
      Out-File c:\scripts\file.mof
  </code></pre>
  
  <p>On the machine in question, we will use:</p>
  
  <pre><code>(GWMI -Namespace "root\CustomName" -List).GetText('mof') |
      Out-File c:\scripts\file.mof
  </code></pre>
  
  <p>Now, I need to figure out the import component.</p>
  
  <p>UPDATE:
  It is a Windows 7 Machine and does not like the:</p>
  
  <pre><code>.GetText('mof') 
  </code></pre>
  
  <p>And shows us:</p>
  
  <pre><code>Method invocation failed because [System.Object[]] doesn't contain a method named 'gettext
  </code></pre>
  
  <p>Checking the vesion of PowerShell, we have:
  2.0</p>
  
  <p>On my Windows 10 system (local) it shows:
  5.1.14393.2248</p>