Public/Get-IsLocalGitRepository.ps1
# Remove-Folder C:\src\Beispiele @("node_modules", "npm-cache") function Get-GitIsLocalRepository { [CmdletBinding()] [OutputType([Boolean])] Param( [System.IO.DirectoryInfo]$item ) $result = $false $isGitFolder = Get-IsGitRepository $item if ($isGitFolder) { $remote = Get-GitRemoteOrigin $item if ([String]::IsNullOrEmpty($remote)) { # Write-Host " -+-+-+- LOCAL REPO -+-+-+- " $result = $true } } else { throw "ArgumentException: Directory is not a git repository" } return $result } |