mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-31 19:26:27 +02:00
Update fetch-repos.ps1 and pull-repos.ps1
This commit is contained in:
parent
c35c7b2786
commit
28a33e074c
@ -27,7 +27,7 @@ try {
|
|||||||
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
||||||
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
||||||
$NumFolders = $Folders.Count
|
$NumFolders = $Folders.Count
|
||||||
"Found $NumFolders subfolders."
|
"Found $NumFolders subfolders, fetching one by one..."
|
||||||
|
|
||||||
[int]$Step = 3
|
[int]$Step = 3
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
@ -41,7 +41,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ fetched $NumFolders Git repos at 📂$ParentDirName in $Elapsed sec"
|
"✔️ fetched $NumFolders Git repos in 📂$ParentDirName, it took $Elapsed sec"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -27,7 +27,7 @@ try {
|
|||||||
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
||||||
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
||||||
$NumFolders = $Folders.Count
|
$NumFolders = $Folders.Count
|
||||||
"Found $NumFolders subfolders."
|
"Found $NumFolders subfolders, pulling one by one..."
|
||||||
|
|
||||||
[int]$Step = 3
|
[int]$Step = 3
|
||||||
[int]$Failed = 0
|
[int]$Failed = 0
|
||||||
@ -45,7 +45,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ pulled $NumFolders Git repos at 📂$ParentDirName in $Elapsed sec ($Failed failed)"
|
"✔️ pulled $NumFolders Git repos in 📂$ParentDirName ($Failed failed, it took $Elapsed sec)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user