我是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」' –