mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-17 23:48:17 +02:00
Improve make-repos.ps1
This commit is contained in:
parent
14c4bc562c
commit
f012228245
@ -13,15 +13,18 @@ try {
|
|||||||
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||||
|
|
||||||
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
||||||
|
$FolderCount = $Folders.Count
|
||||||
$ParentDirName = (get-item "$ParentDir").Name
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
"Building $($Folders.Count) Git repositories at 📂$ParentDirName..."
|
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
||||||
|
|
||||||
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
& "$PSScriptRoot/make-repo.ps1" "$Folder"
|
& "$PSScriptRoot/make-repo.ps1" "$Folder"
|
||||||
|
$Step++
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[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
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user