title: PowerShell get detailed event information from WmiEvent (System.Management.ManagementEventWatcher)
body: <p>I want to get event delails like the event type and drive letter from a Windows Powershell event.</p>
  <pre><code>Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifier volumeChange -Action {
  param($event)
  $eventType = $event.SourceEventArgs.NewEvent.EventType # don't work
  write-host $eventType
  }
  while (1-eq1) {} # don't exit program
  </code></pre>
  <p>This is what i want to achieve. It works on a Windows computer, but because of performance problems it don't work on a Windows tablet:</p>
  <pre><code>Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifier volumeChange
  do {
  $newEvent = Wait-Event -SourceIdentifier volumeChange
  $eventType = $newEvent.SourceEventArgs.NewEvent.EventType
  $driveLetter = $newEvent.SourceEventArgs.NewEvent.DriveName
  write-host $eventType
  Remove-Event -SourceIdentifier volumeChange
  } while (1-eq1) # Loop until next event
  Unregister-Event -SourceIdentifier volumeChange
  </code></pre>