Skip to content

Commit

Permalink
Update forensics_log_pull.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Naveen Angali authored and Naveen Angali committed Dec 7, 2023
1 parent 8812f2f commit 8ab8a21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Azure-ARM/forensics_log_pull.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Select -Pro

#Compress and copy to fileshare
compress-archive -Path "$env:TEMP\all-Logs\$DT\" -DestinationPath "$env:TEMP\all-Logs-$DT.zip"
copy "$env:TEMP\all-Logs-$DT.zip" "C:\fileshare\"
copy "$env:TEMP\all-Logs-$DT.zip" "C:\fileshare\"

#delete older zipped log files more than 30 days
Get-ChildItem -Path C:\Fileshare\* -Include all-logs-*.zip -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(0)} | Remove-Item

0 comments on commit 8ab8a21

Please sign in to comment.