Skip to content

Instantly share code, notes, and snippets.

@tuantmb
Forked from vortexau/decompress.ps1
Created February 23, 2021 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuantmb/df5f6472d4de1c8f2aa6bfe7466a0a4b to your computer and use it in GitHub Desktop.
Save tuantmb/df5f6472d4de1c8f2aa6bfe7466a0a4b 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