Renamed to zip-dir.ps1

This commit is contained in:
Markus Fleschutz
2020-11-22 09:22:35 +00:00
parent 5bee9908c0
commit 2e16b20d56
2 changed files with 6 additions and 4 deletions

18
Scripts/zip-dir.ps1 Executable file
View File

@ -0,0 +1,18 @@
#!/snap/bin/powershell
# Syntax: ./zip-dir.ps1 [<path-to-folder>]
# Description: creates a zip archive of the given folder
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
param([string]$Path)
if ($Path -eq "" ) {
$URL = read-host "Enter path to folder to zip"
}
try {
Compress-Archive -Path $Path -DestinationPath $Path.zip
exit 0
} catch { Write-Error $Error[0] }
exit 1