PowerShell grep quivalent

时间:2016-06-03 14:00:16

标签: bash powershell grep

我正在尝试将此命令行从bash移植到PowerShell:

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

到目前为止,我有这个:

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

但是如何在PowerShell中执行反转匹配(选项 -v grep)?

1 个答案:

答案 0 :(得分:5)

你的意思是-NotMatch

Select-String -NotMatch -Pattern "chain"

Select-String @ Technet