title: Powershell Get-Winevent No events were found that match the specified selection criteria
body: <p>I am writing a Powershell 2.0 script that parses a folder of offline .evtx event logs and generates a csv with specified output. I am only looking for certain event IDs and I am only outputting certain fields to the csv. The problem I run into arises when a specified event ID does not exist in a .evtx file; it generates an error: "Get-WinEvent: No events were found that match the specified selection criteria" (NoMatchingEventsFound). This makes sense, but is there a way to write it in a way to "not care" if the event ID exists and continue to parse? (I am only looking for specific existences of these chosen IDs, and I don't care if they don't exist) Here is my code:</p>
  
  <pre><code> $ReviewFile = ("\\thepath\" + (Get-Date).tostring("dd-MMM-yy") + " Review.csv")
  If (Test-Path $Reviewfile){Remove-Item $ReviewFile}
   $EventLogIDs = "4476","4741","4742" # etc...I have quite a number of IDs
   Get-WinEvent -FilterHashtable @{Path="\\evtxpath\" + (Get-Date).tostring("yyyyMMdd") + "\*Security*";id=@($EventLogIDs);}|
   Select-Object Id,LevelDisplayName,Message,MachineName,RecordId,TaskDisplayName | Export-CSV $ServerReviewFile
  </code></pre>
  
  <p>I have tried to add -ErrorAction silentlycontinue but it skips the entire hashtable.
  I was thinking along the lines of maybe looping through an eventID array with a try and catch within the loop. Would that work? How would that affect the syntax of the hashtable generation code? Any other suggestions? Thank you for your advice</p>