[英]How to select all project except two or three project in Package Manager Console
I have a fairly large solution which has about 150 projects. 我有一个相当大的解决方案,大约有150个项目。 I want to reinstall all packages via Package Manager Console.
我想通过软件包管理器控制台重新安装所有软件包。
I can select any types of packages using Get-Project
and with wild char name. 我可以使用
Get-Project
并使用通配符名称选择任何类型的软件包。 For example for selecting all test projects I use 例如,选择我使用的所有测试项目
Get-Project CompanyName.ProjectName.*.Tests
But currently, I am interested to select all projects except some of them. 但是目前,我有兴趣选择除其中一些项目以外的所有项目。 Say I want to skip three projects called
CompanyName.ProjectA
, CompanyName.ProjectB
and CompanyName.ProjectC
. 说我要跳过三个项目,分别为
CompanyName.ProjectA
, CompanyName.ProjectB
和CompanyName.ProjectC
。 How can I select all projects except those three? 我如何选择除这三个项目以外的所有项目?
I am using Visual Studio 2017 我正在使用Visual Studio 2017
How to select all project except two or three project in Package Manager Console
如何在Package Manager控制台中选择除两个或三个项目以外的所有项目
As we know, The Package Manager Console provides a PowerShell interface within Visual Studio on Windows to interact with NuGet through the specific commands listed. 众所周知,程序包管理器控制台在Windows的Visual Studio中提供了PowerShell界面,可通过列出的特定命令与NuGet进行交互。 So we could also use the PowerShell command line on the Package Manager Console.
因此,我们还可以在程序包管理器控制台上使用PowerShell命令行。 You can use following command line with option
-inotmatch
all projects except those three: 您可以将以下命令行与
-inotmatch
选项-inotmatch
使用,除了这三个项目以外的所有项目:
(Get-ChildItem -Path $path -Recurse -Filter "*.csproj").name -inotmatch 'CompanyName.ProjectA|CompanyName.ProjectB|CompanyName.ProjectC'
Check PowerShell reference for some details. 检查PowerShell参考以获取一些详细信息。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.