Private/Assert-GitIsInstalled.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<#
.SYNOPSIS
This function checks if Git is installed on the current machine.
 
.DESCRIPTION
This function will check if Git is installed on the this machine. Returns $true if installed false if otherwise.
 
.EXAMPLE
Assert-GitIsInstalled;
#>

function Assert-GitIsInstalled()
{
    return (&git version | out-string) -match '(?i)(v|ver|version)\s*\d+\.\d+\.\d+';
}