How do I cloak multiple folders at a time in Team Foundation Server?

本小妞迷上赌 提交于 2019-12-05 05:41:23

问题


I am following the recommended guidance for Team Foundation Server by mapping the root of the source control tree to a local folder. However, I do not want to map every folder underneath that root. I can cloak one folder at a time, but would prefer to cloak a number of folders at once. Is there a way to do so easily?


回答1:


In the Edit Workspaces dialog box, in the Working folders list i suggest to change the setting from Active to Cloaked for each folder.

link : http://msdn.microsoft.com/en-us/library/ms181378(v=vs.110).aspx

based on this link : http://msdn.microsoft.com/en-us/library/ms181378%28VS.80%29.aspx




回答2:


I found another way to do this in PowerShell. Change to the mapped directory where you wish to cloak files and enter the following command:

Get-ChildItem | where {$_.PsIsContainer} | ForEach-Object { Write-Host $_.Name ; tf workfold /cloak $_.Name }

This will cloak every directory at the current folder level. If you wish to exclude certain directories from being cloaked at this level, add the -Exclude parameter:

Get-ChildItem -Exclude <foldernames> | where {$_.PsIsContainer} | ForEach-Object { Write-Host $_.Name ; tf workfold /cloak $_.Name }

where <foldernames> can be one or more folders separated by commas. Preferably each folder name can be embedded in double quotes (to allow spaces, for example).

Also if the tf command does not work, you can use the Set-Alias prior to this as explained in this answer: powershell tf command not recognized as the name of a cmlet



来源:https://stackoverflow.com/questions/20004089/how-do-i-cloak-multiple-folders-at-a-time-in-team-foundation-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!