title: Powershell for checking reboot status after installing windows updates
body: <p>Here is the code i am using for searching Windows updates installed by WSUS, I want to add one more column for the status of reboot pending/done. Is there a switch for that?</p>
  
  <pre><code>$Session = New-Object -ComObject "Microsoft.Update.Session"
  
  $Searcher = $Session.CreateUpdateSearcher()
  
  $historyCount = $Searcher.GetTotalHistoryCount()
  
  $Searcher.QueryHistory(0, $historyCount) | Select-Object Date,
  
     @{name="Operation"; expression={switch($_.operation){
  
         1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}},
  
     @{name="Status"; expression={switch($_.resultcode){
  
         1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"};
  
         4 {"Failed"}; 5 {"Aborted"}
  
  }}}, Title | Out-GridView
  </code></pre>