Last active
October 13, 2015 08:41
-
-
Save sakapon/1e2f02e5277fc801eb7f to your computer and use it in GitHub Desktop.
BuildSample / Create ZIP (PowerShell)
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
# source directory path | |
if (-not ($Args[0])) { return 100 } | |
# target zip file path | |
if (-not ($Args[1])) { return 101 } | |
Add-Type -AssemblyName System.IO.Compression.FileSystem | |
$parent = [System.IO.Path]::GetDirectoryName($Args[1]) | |
[System.IO.Directory]::CreateDirectory($parent) | |
[System.IO.File]::Delete($Args[1]) | |
[System.IO.Compression.ZipFile]::CreateFromDirectory($Args[0], $Args[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment