Rob*_*ein 2 directory version-control tfs cloaking
我通过将源控件树的根映射到本地文件夹来遵循Team Foundation Server的建议指南.但是,我不想映射该根目录下的每个文件夹.我可以一次隐藏一个文件夹,但更喜欢一次隐藏一些文件夹.有办法轻松完成吗?
在编辑中Workspaces dialog box,在Working folders列表中我建议更改Active to Cloaked每个文件夹的设置.
链接:http://msdn.microsoft.com/en-us/library/ms181378(v = vs.110).aspx
基于此链接:http://msdn.microsoft.com/en-us/library/ms181378%28VS.80%29.aspx
我在PowerShell中找到了另一种方法.切换到要隐藏文件的映射目录,然后输入以下命令:
Get-ChildItem | where {$_.PsIsContainer} | ForEach-Object { Write-Host $_.Name ; tf workfold /cloak $_.Name }
Run Code Online (Sandbox Code Playgroud)
这将隐藏当前文件夹级别的每个目录.如果您希望排除某些目录在此级别被隐藏,请添加-Exclude参数:
Get-ChildItem -Exclude <foldernames> | where {$_.PsIsContainer} | ForEach-Object { Write-Host $_.Name ; tf workfold /cloak $_.Name }
Run Code Online (Sandbox Code Playgroud)
其中<foldernames>可以是一个或多个以逗号分隔的文件夹.优选地,每个文件夹名称可以嵌入双引号中(例如,允许空格).
此外,如果tf命令不起作用,您可以使用之前的Set-Alias,如本答案中所述:powershell tf命令未被识别为cmlet的名称