Public/Get-GitRemoteOrigin.ps1
# Remove-Folder C:\src\Beispiele @("node_modules", "npm-cache") function Get-GitRemoteOrigin { [CmdletBinding()] [OutputType([string])] Param( [System.IO.DirectoryInfo]$item ) $result = "" $isGitFolder = Get-IsGitRepository $item if ($isGitFolder) { $result = git -C $item.FullName config --get remote.origin.url } else { throw "ArgumentException: Directory is not a git repository" } return $result } |