Public/Get-GitRepositories.ps1
function Get-GitRepositories { [CmdletBinding()] [OutputType([System.IO.DirectoryInfo[]])] Param( [string]$Path = $pwd ) $result = @() $childs = Get-ChildItem $Path -Directory foreach ($item in $childs) { Write-Debug "------ $($item.FullName) ----------" if ($item -is [System.IO.DirectoryInfo]) { $isGitFolder = Get-IsGitRepository $item if ($isGitFolder) { $result += $item } else { # check subfolders if($item.Name -ne "node_modules"){ $sub = Get-GitRepositories $item.FullName $result += $sub } } } } return $result } Get-GitRepositories C:\src\g-typescipt-templates #get-GitRepositories C:\src\g-dotup | Select-Object {$_.FullName } | write-host # Test-GitFolder C:\src\g-dotup | Format-Table -Property Name, State, Commit, Push, Local, RemoteOrigin, FullName # c:\temp # git status |