Created
July 31, 2017 22:33
-
-
Save celophi/26e422abc3b9c6a9e0082cfe03474243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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