我正在尝试从 CMD
执行以下 powershell 命令,例如:
powershell Get-WmiObject Win32_PnPSignedDriver
powershell Get-WmiObject Win32_PnPSignedDriver > test.txt
两者都可以正常工作。
但是当我进行查询时,例如:
powershell (Get-WmiObject Win32_PnPSignedDriver | where {$_.location -like "*PCI bus 0, device 22, function 0*"}).DeviceName
我收到此消息,我无法确定其原因:
INFO: Could not find files for the given pattern(s)
最佳答案
这似乎对我有用(我看到的错误与您最初看到的错误相同):
powershell -command "(Get-WmiObject Win32_PnPSignedDriver | where {$_.location -like '*PCI bus 0, device 22, function 0*'}).DeviceName"
关于powershell - 在 cmd 和 INFO : Could not find files for the given pattern(s) 下执行 powershell 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43494895/