【发布时间】:2020-12-08 06:44:38
【问题描述】:
我正在编写脚本,我想找出用户提交更改的文件夹名称
$AzureDevOpsPAT = ""
$OrganizationName = ""
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) }
$UriOrga = "https://dev.azure.com/$($OrganizationName)/"
$uriAccount = $UriOrga + "{Project Name}/_apis/git/repositories/{RepositoryID}/items?api-version=6.0-preview.1"
Invoke-RestMethod -Uri $uriAccount -Method get -Headers $AzureDevOpsAuthenicationHeader -ContentType "application/json"
这正在返回(它确实返回最近的提交 ID、对象 ID 但在路径中它只返回 /)
路径=/;
还有
$uriAccount = $UriOrga + "{Project Name}/_apis/git/repositories/{REPO ID}/commits?api-version=6.0-preview.1"
它返回 -
author=; committer=; (Nothing for these values just blank)
Que - 我是否使用了错误的 API 调用?如何获取文件夹名称、提交者名称?
谢谢
【问题讨论】:
标签: powershell azure-devops azure-powershell azure-devops-rest-api azure-repos