move $target out of loop

-Force compress archive if it exists
This commit is contained in:
onyx-and-iris 2023-08-23 16:43:00 +01:00
parent 3f696d86da
commit b6b4c5fd97

View File

@ -1,7 +1,7 @@
function Compress-Builds { function Compress-Builds {
$target = Join-Path -Path $PSScriptRoot -ChildPath "dist"
@("basic", "banana", "potato") | ForEach-Object { @("basic", "banana", "potato") | ForEach-Object {
$target = Join-Path -Path $PSScriptRoot -ChildPath "dist" Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip") -Force
Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip")
} }
} }