2015-11-23 56 views
0

我正在尝试获取在我的TFS服务器上创建的所有工作区的列表。我曾尝试:Powershell获取所有TFS工作区

#if no collection specified, open project picker to select it via gui 
$picker = New-Object Microsoft.TeamFoundation.Client.TeamProjectPicker([Microsoft.TeamFoundation.Client.TeamProjectPickerMode]::NoProject, $false) 
$dialogResult = $picker.ShowDialog() 
if ($dialogResult -ne "OK") 
{ 
    exit 
} 
$tfs = $picker.SelectedTeamProjectCollection 
$tfs.EnsureAuthenticated() 
$vcs = $tfs.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer]); 

$wss = $vcs.QueryWorkspaces($null, $null, $null); 

documentation意味着,如果我通过所有空的作为参数,那么它应该把所有的工作区。我得不到任何回报......

我是一个集合管理员。

回答

5

尝试使用[System.Management.Automation.Language.NullString]::Value而不是$null作为第一个参数。