Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Created June 18, 2025 17:01
Show Gist options
  • Save michaellwest/845bec7e03b8ee4b3a2fa87bd9c9b7b8 to your computer and use it in GitHub Desktop.
Save michaellwest/845bec7e03b8ee4b3a2fa87bd9c9b7b8 to your computer and use it in GitHub Desktop.
Download all log files using Sitecore PowerShell Extensions (SPE).
Import-Function -Name Compress-Archive
# The archive filename will closely resemble the format of the default logfile names.
$archiveName = "logs.$([datetime]::Now.ToString("yyyy-MM-dd.HHmmss"))"
$archiveDirectory = "$($SitecoreDataFolder)\archived\"
$logDirectory = "$($SitecoreDataFolder)\logs\"
$archivePath = Join-Path -Path $archiveDirectory -ChildPath $archiveName
Compress-Archive -Path $logDirectory –CompressionLevel Fastest -DestinationPath $archivePath | Out-Download
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment