Skip to content

Instantly share code, notes, and snippets.

@MateuszNad
Created March 9, 2020 17:55
Show Gist options
  • Select an option

  • Save MateuszNad/03f0f60ded4dc12ead50d8cbc26fdae7 to your computer and use it in GitHub Desktop.

Select an option

Save MateuszNad/03f0f60ded4dc12ead50d8cbc26fdae7 to your computer and use it in GitHub Desktop.
# PowerShell 7 - ForEach and Parallel
$logNames = 'Security','Application','System','Windows PowerShell','Microsoft-Windows-Store/Operational'
$logEntries = $logNames | ForEach-Object -Parallel {
Get-WinEvent -LogName $_ -MaxEvents 10000
} -ThrottleLimit 5
$logEntries.Count
50000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment