Tfs Powershell工具是否在远程工作区工作?

Tfs Powershell工具是否在远程工作区工作?,powershell,tfs,tfs-power-tools,Powershell,Tfs,Tfs Power Tools,你好。 我在远程计算机上创建了一个tfs工作区,并在VisualStudio中使用它。一切正常,入住和退房工作正常。 今天我决定自动化一些任务,但Powershell工具在使用此工作区时会抛出各种错误 我检查了脚本在本地文件夹上的工作-一切正常。 我尝试过使用UNC路径的变体(FileSystem::myPath)、解析路径、获取ChildItem、获取tfschilItem,但所有这些都不起作用。 tf checkout甚至无法确定工作空间 在PowerShell的远程计算机上,是否有可用于工

你好。 我在远程计算机上创建了一个tfs工作区,并在VisualStudio中使用它。一切正常,入住和退房工作正常。 今天我决定自动化一些任务,但Powershell工具在使用此工作区时会抛出各种错误

我检查了脚本在本地文件夹上的工作-一切正常。 我尝试过使用UNC路径的变体(FileSystem::myPath)、解析路径、获取ChildItem、获取tfschilItem,但所有这些都不起作用。 tf checkout甚至无法确定工作空间

在PowerShell的远程计算机上,是否有可用于工作区的变体

第13版的p.S.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".
Upd 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
启动。

请发布包含相关错误的脚本。imho,Powershell似乎未定义您的路径,我尝试搜索类似字符串并找到此线程,您能否尝试使用
convert path
来确定您的远程工作区路径的实际路径,link@Beytan Kurt,我尝试使用convert path。它以\\server\D$\path\fileName模式返回文件名。Add-tfsPendingChange-edit也不能使用此类参数。但我可以在Visual Studio中使用此工作区。VS是否像力学一样使用Enter PSSession?@user3603450不,它不使用。你能在Visual Studio中使用它是什么意思?@EdwardThomson,因为我现在在Visual Studio中使用它