title: Show powershell message box when minimised
body: <p>I have a PowerShell script which is monitoring my filesystem. I would like it to display a message box when a new file is detected in a certain folder.</p>
  
  <p>However because I have my PowerShell script running minimized, the message box does not pop up as expected.</p>
  
  <p>Is there a way to get just the message box to appear on top of all other windows, preferably selected, without un-minimising the PowerShell script?</p>
  
  <p>I generate the message box with this code (although any kind of on screen notification would be good)</p>
  
  <pre><code>### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
      $watcher = New-Object System.IO.FileSystemWatcher
      $watcher.Path= "C:\Users\[...]"
      $watcher.Filter = "*.bin"
      $watcher.IncludeSubdirectories = $true
      $watcher.EnableRaisingEvents = $true  
      Add-Type -AssemblyName PresentationFramework #reference for message box
  ### DEFINE ACTIONS AFTER AN EVENT IS DETECTED
      $action = { [System.Windows.MessageBox]::Show('Binary received') #display msgbox
                }    
  ### DECIDE WHICH EVENTS SHOULD BE WATCHED 
      Register-ObjectEvent $watcher "Created" -Action $action
      while ($true) {sleep 5}
  </code></pre>