Improve make-repos.ps1

This commit is contained in:
Markus Fleschutz 2021-07-02 15:25:25 +02:00
parent 14c4bc562c
commit f012228245

View File

@ -13,15 +13,18 @@ try {
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
$Folders = (get-childItem "$ParentDir" -attributes Directory)
$FolderCount = $Folders.Count
$ParentDirName = (get-item "$ParentDir").Name
"Building $($Folders.Count) Git repositories at 📂$ParentDirName..."
"Found $FolderCount subfolders in 📂$ParentDirName..."
[int]$Step = 1
foreach ($Folder in $Folders) {
& "$PSScriptRoot/make-repo.ps1" "$Folder"
$Step++
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ built $($Folders.Count) Git repositories at 📂$ParentDirName in $Elapsed sec"
"✔️ built $FolderCount Git repositories at 📂$ParentDirName in $Elapsed sec"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"