functions/generated/Approval/Get-AdsPipelineApproval.ps1

function Get-AdsPipelineApproval {
<#
.SYNOPSIS
     
 
.DESCRIPTION
    List Approvals. This can be used to get a set of pending approvals in a pipeline, on an user or for a resource..
 
.PARAMETER Expand
     
 
.PARAMETER ApprovalId
    Id of the approval.
 
.PARAMETER ApprovalIds
     
 
.PARAMETER Project
    Project ID or project name
 
.PARAMETER Organization
    The name of the Azure DevOps organization.
 
.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-AdsPipelineApproval -ApprovalId $approvalid -Project $project -Organization $organization -ApiVersion $apiversion
 
    Get an approval.
 
.EXAMPLE
    PS C:\> Get-AdsPipelineApproval -Project $project -Organization $organization -ApiVersion $apiversion
 
    List Approvals. This can be used to get a set of pending approvals in a pipeline, on an user or for a resource..
 
.LINK
    <unknown>
#>

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

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Approvals_Get')]
        [string]
        $ApprovalId,

        [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $ApprovalIds,

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

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

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Approvals_Get')]
        [string]
        $ApiVersion
    )
    process {
        $__mapping = @{
            'Expand' = '$expand'
            'ApprovalIds' = 'approvalIds'
            'ApiVersion' = 'api-version'
        }
        $__body = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__query = $PSBoundParameters | ConvertTo-Hashtable -Include @('Expand','ApprovalIds','ApiVersion') -Mapping $__mapping
        $__header = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__path = 'https://dev.azure.com/{organization}/{project}/_apis/pipelines/approvals' -Replace '{project}',$Project -Replace '{organization}',$Organization
        if ($ApprovalId) { $__path += "/$ApprovalId" }

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