簡體   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