Modules/Git/GitItems.psm1

function Get-GitItemsBatch {
    [CmdletBinding()]
    [Alias("Get-GitItems")]
    param(
        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
        [ValidateNotNullOrWhiteSpace()]
        [string]$RepositoryId,

        [ValidateNotNullOrWhiteSpace()]
        [string]$Organization = $AzureConsts.CollectionId,
        [ValidateNotNullOrWhiteSpace()]
        [string]$Project = $AzureConsts.ProjectId,
        [string]$ApiVersion = '7.2-preview.1',

        [switch]$IncludeContentMetadata,
        [switch]$IncludeLinks,
        [switch]$LatestProcessedChange
    )

    process {
        $Url = [AzureUrl]::New("https://dev.azure.com/{organization}/{project}/_apis/git/repositories/$RepositoryId/itemsbatch", $Organization, $Project, @{
            'Api-Version' = $ApiVersion
        })

        $Body = @{
            includeContentMetadata = $IncludeContentMetadata.ToBool();
            includeLinks = $IncludeLinks.ToBool();
            latestProcessedChange = $LatestProcessedChange.ToBool();
        }

        Invoke-AzureRequest -Url $Url -Body $Body -ExpectedStatus 200
    }
}

Export-ModuleMember -Function Get-GitItemsBatch -Alias Get-GitItems