functions/generated/Git/Get-AdsGitRepositoryRevert.ps1

function Get-AdsGitRepositoryRevert {
<#
.SYNOPSIS
     
 
.DESCRIPTION
    Retrieve information about a revert operation for a specific branch.
 
.PARAMETER RefName
    The GitAsyncRefOperationParameters generatedRefName used for the revert operation.
 
.PARAMETER Project
    Project ID or project name
 
.PARAMETER Organization
    The name of the Azure DevOps organization.
 
.PARAMETER RepositoryId
    ID of the repository.
 
.PARAMETER RevertId
    ID of the revert operation.
 
.PARAMETER ApiVersion
    Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.
 
.EXAMPLE
    PS C:\> Get-AdsGitRepositoryRevert -Project $project -Organization $organization -RepositoryId $repositoryid -RevertId $revertid -ApiVersion $apiversion
 
    Retrieve information about a revert operation by revert Id.
 
.EXAMPLE
    PS C:\> Get-AdsGitRepositoryRevert -RefName $refname -Project $project -Organization $organization -RepositoryId $repositoryid -ApiVersion $apiversion
 
    Retrieve information about a revert operation for a specific branch.
 
.LINK
    <unknown>
#>

    [CmdletBinding(DefaultParameterSetName = 'default')]
    param (
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $RefName,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Reverts_Get Revert')]
        [string]
        $Project,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Reverts_Get Revert')]
        [string]
        $Organization,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Reverts_Get Revert')]
        [string]
        $RepositoryId,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Reverts_Get Revert')]
        [string]
        $RevertId,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Reverts_Get Revert')]
        [string]
        $ApiVersion
    )
    process {
        $__mapping = @{
            'RefName' = 'refName'
            'ApiVersion' = 'api-version'
        }
        $__body = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__query = $PSBoundParameters | ConvertTo-Hashtable -Include @('RefName','ApiVersion') -Mapping $__mapping
        $__header = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__path = 'https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/reverts' -Replace '{project}',$Project -Replace '{organization}',$Organization -Replace '{repositoryId}',$RepositoryId
        if ($RevertId) { $__path += "/$RevertId" }

        Invoke-RestRequest -Path $__path -Method get -Body $__body -Query $__query -Header $__header
    }
}