Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell grep quivalent

I am trying to port this command line from bash to PowerShell:

git verify-pack -v .git/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head

So far I have this:

git verify-pack -v (Get-ChildItem ".git/objects/pack/pack-*.idx") | select-string -pattern "chain"

But how do I do an invert match in PowerShell (option -v to grep)?

like image 617
u123 Avatar asked Dec 08 '25 14:12

u123


1 Answers

You mean -NotMatch?

Select-String -NotMatch -Pattern "chain"

Select-String @ Technet

like image 164
Frode F. Avatar answered Dec 10 '25 13:12

Frode F.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!