private/Test-CommandGit.ps1
|
function Test-CommandGit { <# .SYNOPSIS Tests whether Git is available in the current session PATH .DESCRIPTION Uses command discovery to locate git in the current session PATH. Returns $true when the command is found; otherwise, returns $false. This function does not verify that Git can execute or inspect installed applications outside PATH. .EXAMPLE PS> Test-CommandGit Tests whether the git command is available in the current session PATH. .INPUTS None. This function does not accept pipeline input. .OUTPUTS System.Boolean. Returns $true when git is found; otherwise, returns $false. .NOTES Author: David Segura Company: Recast Software Version: 1.0.0 Date: 2026-08-28 .LINK Test-InstallGit #> [OutputType([bool])] param () return ($null -ne (Get-Command -Name 'git' -ErrorAction SilentlyContinue)) } |