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 8ab8a21 commit ab668ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Azure-ARM/forensics_log_pull.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ compress-archive -Path "$env:TEMP\all-Logs\$DT\" -DestinationPath "$env:TEMP\all
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
Get-ChildItem -Path C:\Fileshare\* -Include all-logs-*.zip -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | Remove-Item

0 comments on commit ab668ae

Please sign in to comment.