You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/ci/CreateZip.ps1

17 lines
415 B

[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $RootPath
)
$ErrorActionPreference = "Stop"
$ZipPath = "$RootPath-zip"
"Zip the published files to: $ZipPath"
New-Item -ItemType Directory -Force -Path $ZipPath
$dirs = Get-ChildItem -Path $RootPath -Directory -Name
foreach ($dir in $dirs) {
"> Zipping: $RootPath\$dir"
Compress-Archive $RootPath\$dir\* $ZipPath\$dir.zip -Force
}