Improved the scripts

This commit is contained in:
Markus Fleschutz
2021-02-16 19:06:18 +01:00
parent 92f759c1d4
commit 8001d120c6
5 changed files with 14 additions and 7 deletions

View File

@ -8,6 +8,13 @@
param($URL = "")
try {
& wget --version
} catch {
write-error "Can't execute 'wget' - make sure wget is installed and available"
exit 1
}
try {
if ($URL -eq "" ) {
$URL = read-host "Enter URL to download"

View File

@ -1,7 +1,7 @@
#!/bin/powershell
<#
.SYNTAX ./update-repos.ps1 [<directory>]
.DESCRIPTION updates all Git repositories under the current directory
.DESCRIPTION updates all Git repositories under the current/given directory
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
@ -19,10 +19,10 @@ try {
if ($Directory -eq "") {
$Directory = "$PWD"
}
$Items = get-childItem -path $Directory
foreach ($Item in $Items) {
if ($Item.Mode -like "d*") {
$Filename = $Item.Name
$Files = get-childItem -path $Directory
foreach ($File in $Files) {
if ($File.Mode -like "d*") {
$Filename = $File.Name
write-host ""
write-host -nonewline "Updating $Filename ..."
set-location $Filename