Skip to content

Instantly share code, notes, and snippets.

@chrisfesler
Created August 16, 2024 13:01
Show Gist options
  • Save chrisfesler/1298b239ffb2b3b64d036dd4895a5b2c to your computer and use it in GitHub Desktop.
Save chrisfesler/1298b239ffb2b3b64d036dd4895a5b2c to your computer and use it in GitHub Desktop.
# Set variables
$zipUrl = "https://digitalcorpora.s3.amazonaws.com/corpora/files/govdocs1/zipfiles/000.zip"
$zipFile = ".\000.zip"
$unzipPath = ".\unzipped"
# Measure download time
$downloadTime = Measure-Command {
Invoke-WebRequest -Uri $zipUrl -OutFile $zipFile
}
Write-Host "Download Time: $($downloadTime.TotalSeconds) seconds"
# Create the directory for unzipping
New-Item -ItemType Directory -Path $unzipPath -Force | Out-Null
# Measure unzip time using 7-Zip
$unzipTime = Measure-Command {
& "7z.exe" x $zipFile -o$unzipPath -y
}
Write-Host "Unzip Time: $($unzipTime.TotalSeconds) seconds"
# Clean up
Remove-Item $zipFile -Force
Remove-Item $unzipPath -Recurse -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment