Skip to content

Instantly share code, notes, and snippets.

@timlegge
Forked from vortexau/decompress.ps1
Created January 6, 2019 03:00
Show Gist options
  • Save timlegge/4c8c9e061dc5945d7eb4edc14bb81d24 to your computer and use it in GitHub Desktop.
Save timlegge/4c8c9e061dc5945d7eb4edc14bb81d24 to your computer and use it in GitHub Desktop.
Powershell to decompress DEFLATE data
$base64data = "insert compressed and base64 data here"
$data = [System.Convert]::FromBase64String($base64data)
$ms = New-Object System.IO.MemoryStream
$ms.Write($data, 0, $data.Length)
$ms.Seek(0,0) | Out-Null
$sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.DeflateStream($ms, [System.IO.Compression.CompressionMode]::Decompress))
while ($line = $sr.ReadLine()) {
$line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment