Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

check multiple errors on regex

Hello

Is is possible to search multiple error on regex, please ?

$errorlog = "C:\temp\error.log"  
$Regex   = [regex]::Escape('ERR1456|ERR1122')
 
$Error = Get-Content -Path $errorlog|
Where-Object { $_ -match $Regex  }

If ($Error -contains 'ERR1456') {
        

   echo $Error
        

}

Thank you

Regards 
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial