Created
April 21, 2016 13:42
-
-
Save Meatballs1/6490ce3833936eb185f34da4629dc854 to your computer and use it in GitHub Desktop.
Simple Powershell Compression
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
$path = "C:\data\sysvol_results.csv" | |
$inStream = new-object System.IO.FileStream($path, [System.IO.FileMode]::Open); | |
$outStream = new-object System.IO.FileStream("$($path).gz", [System.IO.FileMode]::CreateNew); | |
$compressionStream = new-object System.IO.Compression.GZipStream($outStream, [System.IO.Compression.CompressionMode]::Compress); | |
$inStream.CopyTo($compressionStream); | |
$inStream.Close(); | |
$compressionStream.Close(); | |
$outStream.Close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment