title: Powershell script works but also gives an error message
body: <p>The error is as follows:</p>
  
  <pre><code>You cannot call a method on a null-valued expression.
  At C:\Across.ps1:6 char:21
  + $result.Handle.Close &lt;&lt;&lt;&lt; ()
  + CategoryInfo          : InvalidOperation: (Close:String) [],
  RuntimeException
  + FullyQualifiedErrorId : InvokeMethodOnNull
  </code></pre>
  
  <p>The script is as follows:</p>
  
  <pre><code># Load ntuser.dat
  reg load HKU\Across C:\users\Default\NTUSER.DAT
  
  # Create a new key, close the handle, and trigger garbage collection
  $result = New-Item -Path
  'Registry::HKEY_USERS\Across\Software\AcrossStuff'
  $result.Handle.Close()
  [gc]::Collect()
  
  #Unload ntuser.dat
  reg unload HKU\Across
  </code></pre>
  
  <p>Can you please help me fix this.
  Thanks!</p>