-
Notifications
You must be signed in to change notification settings - Fork 1
Invoke‑Git
Invokes a git command.
Invoke-Git [-Path] <String> [[-Timeout] <Int32>] [-PassThru] [[-Arguments] <String[]>]
[<CommonParameters>]
Invokes a git command with command line arguments using System.Diagnostics.Process.
Throws an error when git ExitCode -ne 0 and -PassThru switch -eq $false (or omitted).
Invoke-Git -Path 'C:\SomeDirectory' -Arguments @( 'clone', 'https://github.com/X-Guardian/xActiveDirectory.wiki.git', '--quiet' )
Invokes the Git executable to clone the specified repository to the working directory.
Invoke-Git -Path 'C:\SomeDirectory' -Arguments @( 'status' ) -Timeout 10000 -PassThru
Invokes the Git executable to return the status while having a 10000 millisecond timeout.
$result = Invoke-Git -Path 'C:\SomeDirectory' -Arguments @( 'status' ) -PassThru
Invokes the Git executable to return the status and stores the result in the $result variable.
The $result variable will contain a hashtable with the following keys: ExitCode StandardOutput StandardError
Invoke-Git -Path $script:testRepoPath -Arguments @('config', 'user.name', '"Test User"')
Configures the git user name for the repository located in $script:testRepoPath.
The arguments to pass to the Git executable.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSwitch parameter when enabled will return result object of running git command.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe path to the git working directory.
Type: String
Parameter Sets: (All)
Aliases: WorkingDirectory
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseMilliseconds to wait for process to exit.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 120000
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Assert-GitLocalChange
- Assert-GitRemote
- Assert-IPv4Address
- Clear-AnsiSequence
- ConvertTo-AnsiSequence
- ConvertTo-AnsiString
- ConvertTo-DifferenceString
- ConvertTo-RelativePath
- Disable-CursorShortcutCode
- Get-ClassAst
- Get-ClassResourceAst
- Get-GitBranchCommit
- Get-GitLocalBranchName
- Get-GitRemote
- Get-GitRemoteBranch
- Get-GitTag
- Get-LinkLayerAddress
- Get-ModuleByVersion
- Get-ModuleFileSha
- Get-ModuleVersion
- Get-NumericalSequence
- Get-PSReadLineHistory
- Get-TextOffset
- Install-ModulePatch
- Invoke-Git
- Invoke-PesterJob
- New-GitTag
- New-SamplerGitHubReleaseTag
- Out-Difference
- Pop-VMLatestSnapshot
- Push-GitTag
- Receive-GitBranch
- Remove-GitTag
- Remove-History
- Remove-PSHistory
- Remove-PSReadLineHistory
- Rename-GitLocalBranch
- Rename-GitRemote
- Request-GitTag
- Resolve-DnsName
- Resume-GitRebase
- Send-WakeOnLan
- Split-StringAtIndex
- Start-GitRebase
- Stop-GitRebase
- Switch-GitLocalBranch
- Test-FileHash
- Test-GitLocalChanges
- Test-GitRemote
- Test-GitRemoteBranch
- Test-IPv4Address
- Update-GitLocalBranch
- Update-RemoteTrackingBranch