我正在开发自动化过程,涉及将某些数据文件签入到具有门控签入过程的构建中。在PowerShell中,我的代码在一起,就像这样:使用Powershell绕过TFS门控签入
$pendings = $ws.GetPendingChanges()
if($pendings.Count -gt 0)
{
$ws.CheckIn($pendings, $checkInComments);
}
此代码的功能完好,如果它是在手动检查的区域,我已经添加的所有的DLL等。但是,如果构建是门控,它失败了,有:
Exception calling "CheckIn" with "2" argument(s):
"Your check-in could not be completed because it affects the following gated build definitions.
我发现在C#中完成过这个问题下面的答案,但我似乎无法过来翻译成PowerShell的,据我所知,。如果我添加了适当的DLL,我应该可以使用网络方法。
var pendingChanges = workspace.GetPendingChanges();
if (pendingChanges.Any())
{
WorkspaceCheckInParameters parameters = new WorkspaceCheckInParameters(pendingChanges, BuildCommonUtil.NoCICheckInComment)
{
OverrideGatedCheckIn = true,
};
workspace.CheckIn(parameters);
}
有没有人有关于如何绕过闸门(权限假设)在Powershell的想法?