Tfs Powershell工具是否适用于远程工作空间?

时间:2015-05-22 11:18:39

标签: powershell tfs tfs-power-tools

美好的一天。 我在远程计算机上创建了一个tfs-workspace,并在Visual Studio中使用它。所有罚款,签到和退房工作都正常。 今天我决定自动完成一些任务,但Powershell工具在使用这个工作区时会抛出各种错误。

我检查了脚本在本地文件夹上的工作 - 一切都很好。 我试图使用UNC路径(FileSystem :: myPath),Resolve-Path,Get-ChildItem,Get-TfsChildItem的变体,但所有这些都没有用。 结帐甚至无法确定工作区。

PowerShell中的远程计算机上的工作区是否有任何变体?

P.S。第13版的TFS,VS,TFPT。 P.P.S.我不能使用“净使用”或它的类似物。

P.P.P.S命令和结果:

Microsoft.PowerShell.Core\FileSystem::\\srv-tfsmain\D$\NetWorkspace\MyUser\Test> tf checkout 15
tf : Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.


Microsoft.PowerShell.Core\FileSystem::\\srv-tfsmain\D$\NetWorkspace\MyUser\Test> Add-TfsPendingChange -edit 15
Add-TfsPendingChange : The filename, directory name, or volume label syntax is incorrect. $path


Microsoft.PowerShell.Core\FileSystem::\\srv-tfsmain\D$\NetWorkspace\MyUser\Test> Add-TfsPendingChange -edit (Resolve-Path 15)
Add-TfsPendingChange : Cannot bind parameter 'Item'. Cannot convert the "Microsoft.PowerShell.Core\FileSystem::\\srv-tfsmain\D$\NetWorkspace\MyUser\Test\15" value of type "System.Management.Automation.PathInfo" to type "Microsoft.TeamFoundation.PowerTools.PowerShell.QualifiedItemSpec".

更新1.错误的路径不正确:工作区已映射到\ srv-tfsmain \ NetWorkspace \ MyUser \ Test,我在\ srv-tfsmain \ D $ \ NetWorkspace \ MyUser \ Test中使用了命令。纠正路径后,tf工作正常,但

Add-TfsPendingChange -edit

不适用于任何形式的UNC路径。

1 个答案:

答案 0 :(得分:2)

它无法正常工作。 TFS工作空间概念意味着您为命令提供在工作空间中定义的相同路径。因此,如果在 PC01 上定义了将$/MyProject映射到C:\wrk01的工作区 WRK01 ,则必须使用C:\wrk01在本地运行命令; \\PC01\c$\work01或其他方式无法工作。

使用Powershell,您可以使用远程会话在本地运行cmdlet(但它们必须安装在目标计算机上),请参阅Enter-PSSession以启动。

相关问题