diff --git a/BuildHelpers/Public/Get-BuildVariables.ps1 b/BuildHelpers/Public/Get-BuildVariables.ps1 index 182f27d..fcc7f6e 100644 --- a/BuildHelpers/Public/Get-BuildVariables.ps1 +++ b/BuildHelpers/Public/Get-BuildVariables.ps1 @@ -75,7 +75,7 @@ function Get-BuildVariables { $Path = ( Resolve-Path $Path ).Path $Environment = Get-Item ENV: if(!$PSboundParameters.ContainsKey('GitPath')) { - $GitPath = (Get-Command $GitPath -ErrorAction SilentlyContinue)[0].Path + $GitPath = (Get-ChildItem ($env:PATH -split ';') -filter git.exe -ErrorAction SilentlyContinue | Select-Object -First 1).Fullname } $WeCanGit = ( (Test-Path $( Join-Path $Path .git )) -and (Get-Command $GitPath -ErrorAction SilentlyContinue) )