我是PowerShell的初学者,怀疑什么是简单的问题。我试图做下面的命令,但它没有返回任何结果,我不明白为什么。powershell select-string无法正常工作
我试图得到bcdedit的当前部分的描述。如果我做的:
bcdedit /enum | select-string "identifier.*current" -context 0,3
它返回如下:
> identifier {current}
device partition=C:
path \WINDOWS\system32\winload.exe
description Windows 8.1
那么,为什么不下列返回description Windows 8.1
?
bcdedit /enum | select-string "identifier.*current" -context 0,3 | select-string "description"
相反,它什么也没有返回。
任何信息,将不胜感激。
或者稍微简单,你可以使用'出串-stream'给选择串一些字符串搜索再次:'BCDEDIT /枚举|选择字符串“标识符。*当前”-Context 0,3 | Out-String -Stream | Select-String“description”' –