Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function Expand-Bytes {
param (
[Parameter(
Mandatory=$true,
ValueFromPipeline=$true)]
$bytes
)
$outstream = New-Object System.IO.MemoryStream
$ms = [System.IO.MemoryStream]::New($bytes)
$ds = [System.IO.Compression.DeflateStream]::New($ms, [System.IO.Compression.CompressionMode]::Decompress)
$ds.CopyTo($outstream)
$result = $outstream.ToArray()
Write-Host (($result | % { "{0:X2}" -f $_ }) -join " ")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment