With some people help me, I have this "script" to get all differents malwares detections based on date + VM name + Path.
This is usefull to avoid read several files.
Code: Select all
$Path = "C:\ProgramData\Veeam\Backup\Malware_Detection_Logs\"
$Files = (Get-ChildItem -Path $Path).FullName
Select-String -Path $Files -Pattern '^\[(?<Date>[^\]]+).+\s(?<VM>[^:]+):.+?:(?<File>.+)' -AllMatches |
ForEach-Object {
$match = $_.Matches[0]
[PSCustomObject]@{
Date = $match.Groups['Date'].Value
VM = $match.Groups['VM'].Value
File = $match.Groups['File'].Value
}
} |
Sort-Object VM, File -Unique
