Hi,
Please try this. Set $LogName to the name of the log you want to check.
$LowerLimit = Read-Host -Prompt "Lower Limit"
$UpperLimit = Read-Host -Prompt "Upper Limit"
$LogName = "Microsoft-Windows-PowerShell/Operational"
Get-WinEvent -LogName $LogName | Where-Object { ($_.id -gt $LowerLimit) -and ($_.id -lt $UpperLimit)}
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.