We are using the Microsoft Malicious Software Removal Tool and it creates an MRT.log file on a network share on the server.
I need a script to parse all the logs (500+) and see if it can match any "Return Code: 6 - 9" if yes than copy the log to a different share and write the name the of the log to a csv file.
I know I have to use regex but I have no clue how.
This is what I have:
$logfiles = "C:\Windows\debug\MRTLOGS"
foreach ($logs in $logfiles){
if (select-string -Pattern "Return code: 6"){
#Write-Host ($_.name)
}
}
Thanks