Misc/Invoke-git.ps1
<#
.Synopsis PREVIEW: Invoke git command with parameters .Description Requires Git installed #> function invoke-git { Param( [parameter(mandatory = $true, position = 0)][string] $command, [parameter(mandatory = $false, position = 1, ValueFromRemainingArguments = $true)] $remaining ) $arguments = "$command " $remaining | ForEach-Object { if ("$_".IndexOf(" ") -ge 0 -or "$_".IndexOf('"') -ge 0) { $arguments += """$($_.Replace('"','\"'))"" " } else { $arguments += "$_ " } } cmdDo -command git -arguments $arguments -silent } Export-ModuleMember -Function Invoke-git |