简体   繁体   中英

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. 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. 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 . How can I select all projects except those three?

I am using Visual Studio 2017

How to select all project except two or three project in Package Manager Console

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. So we could also use the PowerShell command line on the Package Manager Console. You can use following command line with option -inotmatch all projects except those three:

(Get-ChildItem -Path $path -Recurse -Filter "*.csproj").name -inotmatch 'CompanyName.ProjectA|CompanyName.ProjectB|CompanyName.ProjectC'

Check PowerShell reference for some details.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM