Created
October 13, 2020 08:51
-
-
Save sbalaji6/95bdcb595b35f1793f9ce3d0c491defb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string]$randNo = Get-Random | |
$tempFolder = $($env:temp)+"\Logs"+"-"+$randNo+"-$(Get-Date -UFormat "%m%d%Y%H%M%S")" | |
New-Item -Path $tempFolder -ItemType Directory | |
$eventLogs = "event-logs" | |
#Copy event logs | |
New-Item -Path "$($tempFolder)\$($eventLogs)" -ItemType Directory | |
Copy-Item -Path "$env:SystemRoot\System32\Winevt\Logs\*" -Destination "$($tempFolder)\$($eventLogs)" -Recurse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment