質問

I am trying to get the list of 3rd party drivers installed on a Windows 8 machine.

gwmi win32_systemdriver| ? ((Get-ItemProperty $psitem.pathname).VersionInfo).companyname -NotLike *microsoft*

Error : Get-ItemProperty : Cannot bind argument to parameter 'Path' because it is null.

Is there a one-liner way getting around this problem.

役に立ちましたか?

解決

Answer moved from comment discussion on question:

Say that you want to show the Status, State, Name and CompanyName properties for each of the found items, you could do something like the following:

gwmi win32_systemdriver | 
    select *, @{ N='CompanyName';E={ (Get-ItemProperty $_.pathname -ErrorAction Ignore).VersionInfo.companyname }} | 
    Where companyname -NotLike "*microsoft*" | 
    sort state | 
    ft Status, State, Name, ExitCode, CompanyName.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top