我必须提供哪种凭据才能使其正常工作
$tfsServer = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($basePath,$credential)
我试过了:
$credential = New-Object System.Management.Automation.PsCredential($user,$password)
和
$credential = New-Object System.Net.NetworkCredential($user, $password, $domane)
并且总是得到
Für "GetServer" und die folgende Argumenteanzahl kann keine Überladung gefunden werden: "2".
Bei Zeile:18 Zeichen:86
+ $tfsServer = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer <<<< ($basePath,$credential)
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
我想用
TeamFoundationServerFactory.GetServer Method (String, ICredentialsProvider)
参看。http://msdn.microsoft.com/en-us/library/bb136201%28v=vs.80%29.aspx
背景是,我想在远程 PowerShell 会话中调用它,出于某种原因,我不明白
$tfsServer = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($basePath)
产量
“TF30063:您无权访问 mytfs\MccCollection。”