Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Powershell search registry content in event log
  2. Get-ItemProperty -path hklm:systemcurrentcontrolsetenumusbstor** | select PSChildName
  3.        
  4. Get-ItemProperty -path hklm:systemcurrentcontrolsetenumusbstor** | select PSChildName | foreach-object {Get-Content C:Windowsinfsetupapi.dev.log | select-string '$_.PSChildName' -context 1}
  5.        
  6. Get-ItemProperty -path hklm:systemcurrentcontrolsetenumusbstor** | select PSChildName | foreach-object {$P = $_.PSChildName ; Get-Content  C:Windowsinfsetupapi.dev.log | select-string $P -SimpleMatch -context 1}
  7.        
  8. $KeyListArray = @()
  9.     Foreach($key in Get-ItemProperty -path hklm:systemcurrentcontrolsetenumusbstor** | select PSChildName)
  10.     {$KeyListArray +($key)}
  11.  
  12.  
  13. foreach($PsChild in $KeyListArray)
  14. {Get-Content C:Windowsinfsetupapi.dev.log | select-string -Pattern "$PsChild" -context 1}