繁体   English   中英

Tfs Powershell工具可以在远程工作空间中工作吗?

[英]Do Tfs Powershell tools work wtih remote workspaces?

美好的一天。 我在远程计算机上创建了一个tfs-workspace,并在Visual Studio中使用它。 所有罚款,入住和退房均能正常工作。 今天,我决定自动化一些任务,但是Powershell工具在使用该工作区时会引发各种错误。

我检查了脚本在本地文件夹上的工作-一切正常。 我尝试使用UNC路径(FileSystem :: myPath),Resolve-Path,Get-ChildItem,Get-TfsChildItem的变体,但是所有这些都行不通。 tf checkout甚至无法确定工作空间。

在PowerShell中可以使用任何变体与远程计算机上的工作区一起使用吗?

PS TFS,VS,TFPT的第13版。 PPS我不能使用“网络使用”或类似的方式。

PPPS命令和结果:

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路径。

它不能那样工作。 TFS工作空间的概念意味着您要给命令提供与工作空间中定义的相同的路径。 因此,如果在PC01上定义了将$/MyProject映射到C:\\wrk01工作空间WRK01 ,则必须使用C:\\wrk01在本地运行命令; \\\\PC01\\c$\\work01否则将不起作用。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM