Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Tools/make_samples_zip.ps1: switch to 7za.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
mahilleb-msft committed Feb 23, 2017
1 parent 1397c0d commit f75dd14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Tools/make_samples_zip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
[CmdletBinding()]
Param([Parameter(Mandatory=$true)][string]$Output)

if (-not (Get-Command -ErrorAction SilentlyContinue 7za.exe)) {
throw "7za.exe not found in path"
}

Set-StrictMode -Version Latest

$ErrorActionPreference = 'Stop'
Expand All @@ -29,8 +33,10 @@ Copy-Item -ErrorAction Stop -Verbose:$isVerbose -Recurse Examples, Tutorials -De
Push-Location SamplesZip

try {
Add-Type -assembly "System.IO.Compression.FileSystem"
[IO.Compression.ZipFile]::CreateFromDirectory((Get-Location).Path, $Output)
7za.exe a -bd $Output .
if ($LASTEXITCODE -ne 0) {
throw "7za.exe returned non-zero exit code $LASTEXITCODE"
}
} finally {
Pop-Location
}

0 comments on commit f75dd14

Please sign in to comment.