Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $file=$ENV:TEMP
- $date=$(get-date -f d)
- Get-WinEvent -FilterHashTable @{LogName='System';LEVEL='1','2'} | Format-Table TimeCreated, ProviderName, Id, LevelDisplayName, Message -AutoSize -Wrap | Out-String -Width 1024 | Out-File "$file\$date.err"
- Compress-Archive $file\*.err -DestinationPath D:\$date.zip
- Remove-Item $file\*.err
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement