-
Notifications
You must be signed in to change notification settings - Fork 10
Invoke‑Git
Invokes a git command.
Invoke-Git [-WorkingDirectory] <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 -WorkingDirectory '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 -WorkingDirectory 'C:\SomeDirectory' -Arguments @( 'status' ) -TimeOut 10000 -PassThru
Invokes the Git executable to return the status while having a 10000 millisecond timeout.
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: False
Switch 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: False
Milliseconds 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: False
The path to the git working directory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.