mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Improve fetch-repos.ps1 and pull-repos.ps1
This commit is contained in:
parent
f8ca4ed78b
commit
e3c9ab459e
@ -10,6 +10,7 @@ param($ParentDir = "$PWD")
|
||||
|
||||
try {
|
||||
"Fetching updates for Git repositories under $ParentDir ..."
|
||||
$StartTime = get-date
|
||||
|
||||
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||
set-location $ParentDir
|
||||
@ -29,7 +30,9 @@ try {
|
||||
$Count++
|
||||
}
|
||||
|
||||
write-host -foregroundColor green "OK - fetched updates for $Count Git repositories under $ParentDir"
|
||||
$StopTime = get-date
|
||||
$TimeSpan = new-timeSpan -start $StartTime -end $StopTime
|
||||
write-host -foregroundColor green "OK - fetched updates for $Count Git repositories under $ParentDir in $($TimeSpan.seconds) second(s)"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -10,6 +10,7 @@ param($ParentDir = "$PWD")
|
||||
|
||||
try {
|
||||
"Pulling updates for Git repositories under $ParentDir ..."
|
||||
$StartTime = get-date
|
||||
|
||||
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||
set-location "$ParentDir"
|
||||
@ -29,7 +30,10 @@ try {
|
||||
set-location ..
|
||||
$Count++
|
||||
}
|
||||
write-host -foregroundColor green "OK - pulled updates for $Count Git repositories under $ParentDir"
|
||||
|
||||
$StopTime = get-date
|
||||
$TimeSpan = new-timeSpan -start $StartTime -end $StopTime
|
||||
write-host -foregroundColor green "OK - pulled updates for $Count Git repositories under $ParentDir in $($TimeSpan.seconds) second(s)"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user