Link to home
Start Free TrialLog in
Avatar of infradatel
infradatel

asked on

Powershell Where-Object equals mulitple values

I want to use powershell script to list all events in an event log that are of specific event IDs,

I have this so far:

Get-EventLog "File Replication Service" | Where-Object {$_.EventID -eq 13509}

This will obviously list all Event IDs 13509 in the File replication service log, but I want to expand my script so it will list events of 13509,13508 etc

What command do I use instead of the -eq is there an or command?
SOLUTION
Avatar of Pramod Ubhe
Pramod Ubhe
Flag of India image

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
ASKER CERTIFIED SOLUTION
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
Get-EventLog "File Replication Service" | Where-Object {$_.EventID -match '13509|13508'}
SOLUTION
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
Avatar of infradatel
infradatel

ASKER

Thanks very much guys works a treat