title: Powershell - Access global synchronized hash table from custom event handler
body: <p>I'm trying to access <code>$syncHash</code> inside the event handler scriptblock, but seems nothing happened. Is there a way to to it?</p>
  <pre><code>$syncHash = [hashtable]::Synchronized(@{})
  $syncHash.PostPocess = {
      [string]$path = $event.messagedata
      ...
      # trying to access $syncHash here, but failed
      ...
  }
  
  Register-EngineEvent -SourceIdentifier Process_Result -Action $syncHash.PostPocess
  New-Event -SourceIdentifier Process_Result -MessageData $path
  </code></pre>
  <p>Thanks,</p>