mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Renamed to zip-dir.ps1
This commit is contained in:
parent
5bee9908c0
commit
2e16b20d56
@ -40,7 +40,7 @@ The following PowerShell scripts can be found in the `Scripts/` subfolder:
|
||||
* [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report
|
||||
* [weather-worldwide.ps1](Scripts/weather-worldwide.ps1) - prints the current weather of cities world-wide
|
||||
* [wakeup.ps1](Scripts/wakeup.ps1) - sends a magic packet to the given computer, waking him up
|
||||
* [zipdir.ps1](Scripts/zipdir.ps1) - creates a zip archive of the given folder
|
||||
* [zip-dir.ps1](Scripts/zip-dir.ps1) - creates a zip archive of the given folder
|
||||
|
||||
What is PowerShell?
|
||||
-------------------
|
||||
|
@ -1,13 +1,15 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./zipdir.ps1 <path-to-folder>
|
||||
# Description: creates a zip archive from the given folder
|
||||
# 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
|
Loading…
Reference in New Issue
Block a user