Package Manager Console search on Id only

If I enter this command...

Get-Package -ListAvailable -Filter newtonsoft

I get a listing of all packages that reference the string 'newtonsoft' in their Id or Description/Release Notes fields. Is there a way to search the Id field only?

Answers


You can use the Where-Object cmdlet to filter the results. The $_ represents the current object in the pipeline:

Get-Package -ListAvailable -Filter newtonsoft | Where {$_.<prop-name> -match '<regex>'}

Note that the -match operator matches the value of the specified property name to the specified regular expression. Specifically I think you want this:

Get-Package -ListAvailable -Filter newtonsoft | Where {$_.Id -match 'newtonsoft'}

Need Your Help

UTC clock based on server time?

php javascript date time

I have a JavaScript clock that gets the time in UTC, it currently works, but the time is based off the client's computer. What could I do to base the time off of the server instead? I am using PHP ...

What's the fastest way to merge/join data.frames in R?

performance r join merge data.table

For example (not sure if most representative example though):

Database files and ASP.NET Login controls

asp.net sql-server security login

I was trying the ASP.NET login control tutorial and everything works well. However, I do not know how to have the Log-in control use my own database (SQL Server 2005) instead of using it's mdf file...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.