击:
$>环境| grep" lib"
如何在powershell中执行此操作?
我尝试过但不起作用:
PS1> get-childitem env:\ | foreach-object {if($ _。Value -contains' Lib'){write-output $ _.Name}}
由于
答案 0 :(得分:3)
尝试:
get-childitem env:\ | Where-Object {$_.Value -Match "Lib"}