Skip to content

Instantly share code, notes, and snippets.

@Geertvdc
Last active February 26, 2016 15:17
Show Gist options
  • Save Geertvdc/1f1a92181af88fd1fee8 to your computer and use it in GitHub Desktop.
Save Geertvdc/1f1a92181af88fd1fee8 to your computer and use it in GitHub Desktop.
Create a zip file from UWP appxPackage folder
Param(
[string]$dir
)
function ZipFiles( $zipfilename, $sourcedir )
{
Add-Type -Assembly System.IO.Compression.FileSystem
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory($sourcedir,
$zipfilename, $compressionLevel, $false)
}
$folderName = Get-ChildItem "$dir\AppxPackages\" | Select-Object -first 1
Write-Host "creating zip of folder $dir\AppxPackages\"
ZipFiles "$($dir)\$($folderName.Name).zip" "$dir\AppxPackages\";
Write-Host "created zip file with name $($dir)\$($folderName.Name).zip"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment