public/git/Get-PSTSGitRepositoryItemFile.ps1
function Get-PSTSGitRepositoryRefItemFile { param( [Parameter(Mandatory=$true)][string] $project, [Parameter(Mandatory=$true)][string] $repository, [Parameter(Mandatory=$true)][string] $branch, [Parameter(Mandatory=$true)][string] $filePath ) process { $id=Get-PSTSGitRepository -project $project | Where-Object { $_.name -eq $repository } | Select-Object -ExpandProperty id if ($null -eq $id) { throw [exception]::new("repository Id for $repository could not be found") return } $content = ` _PSTSAPI ` -resource "git/repositories/$id/items" ` -method "GET" ` -project $project ` -apiVersion "api-version=5.0-preview.1" ` -queryParameters "path=/$($filePath)&versionDescriptor[version]=$($branch)&includeContent=true&download=false&resolveLfs=true" return [GitItem]$content } } |