Before you can upload the created PSADT package, you need to compress them. We provide a handy little script for that purpose that you can download xoap-compress-subfolders.ps1.
Script content #
<#
.SYNOPSIS
This is a script to create compressed files for the Package Management upload.
.DESCRIPTION
In order to upload PSADT packages successfully to infra.XO with the frontend all PSADT Packages must be zipped.
The folders must not contain any other subfolders (this happens if you create zipped files with a Mac or some other zippers available).
.NOTES
File Name : xoap-compress-subfolders.ps1
Author : XOAP.io - info@XOAP.io
Requires : PowerShell V2 (please change as needed)
Script version : 1.0.0
#>
$packagepath = Read-Host "Please input the path to the PSADT Packages folder"
$folderlist = Get-ChildItem -Path $packagepath -Directory
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)
}
Foreach ($Folder in $folderlist)
{ZipFiles "$($Folder.Fullname).zip" "$($Folder.Fullname)"}
Use this script to assure that the folder structure within the zipped file is created as expected by our upload process. Some zippers create sub-folders within a zip. In this case, the upload process might fail.