Team Services 계정에 대해 TFS 2013 Power Tools와 함께 제공되는 PowerShell cmdlet을 실행할 수 없습니다. 문제가있는 명령은 Get-TfsItemHistory
및 Get-TfsChangeset
입니다. TFS는 호스트되지 않은 인스턴스에서는 잘 작동하지만 Team Services에서는 작동하지 않습니다. tf.exe
및 tfpt.exe
을 사용하여 팀 서비스에 성공적으로 연결할 수 있습니다. 내 스크립트는 던져진 예외와 함께 아래에 표시됩니다. 이러한 명령을 Team Services와 함께 사용할 수 있습니까? 그렇다면 무엇이 잘못 되었습니까? 감사합니다. .Microsoft.TeamFoundation.PowerTools.PowerShell cmdlet을 사용하여 Visual Studio Team Services (VSO)를 쿼리하는 방법
#my Team Services credentials:
$Username = "[email protected]"
$tfsPath = "https://myname.visualstudio.com/"
$passwordFile=".\ps-password.pwd"
# read passsword from file
# NOTE: password previously stored within file using command:
# read-host -prompt Password -assecurestring |
# convertfrom-securestring |
# out-file ps-password.pwd -ErrorAction Stop
if (!(test-path $passwordFile))
{
throw [System.IO.FileNotFoundException] "$passwordFile"
}
$Password = Get-Content "$passwordFile" | ConvertTo-SecureString
$creds = New-Object -typename System.Management.Automation.PSCredential -ArgumentList $Username,$Password
$tfsServer = New-Object System.Uri("$tfsPath")
$tfsCollection = New-Object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection($tfsServer,$creds)
$tfsCollection.Authenticate()
# $tfsCollection | show-object # NOTE: content of collection looks good when viewed
# PROBLEM COMMANDS:
Get-TfsChangeset -latest -server $tfsCollection
Get-TfsItemHistory "$/" -Server $tfsCollection -Version "D2010-01-01~D2016-08-01" -Recurse -IncludeItem
오류 발생 :
Get-TfsChangeset : The filename, directory name, or volume label syntax is incorrect.
At ~\myScript.ps1:30 char:1
+ Get-TfsChangeset -latest -server $tfsCollection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-TfsChangeset], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.TeamFoundation.PowerTools.PowerShell.GetTfsChangesetCommand
어떤 문제가 보이면 변경 세트를 성공적으로 가져올 수 있습니다. "Get-TfsChangeset"을 실행했을 때 제공 한 오류가 $ tfsCollection.Authenticate() 중에 오류가 발생 했습니까? 나는 또한 이전에 사용했던 powershell 스크립트를 추가하여 참조 용 changeset를 얻었습니다. –