當然,如果你不想刪除where
別名指向Where-Object
,您可以鍵入.exe
(輸入.
,然後按TAB鍵就夠了),如:
where.exe notepad
否則,您是否使用-All
參數(PowerShell 3及更高版本)嘗試Get-Command
(別名gcm
)?例如:
gcm notepad -All
我的機器上,給出了:
CommandType Name Version Source
----------- ---- ------- ------
Application notepad.exe 10.0.10... C:\Windows\system32\notepad.exe
Application notepad.exe 10.0.10... C:\Windows\notepad.exe
而且它會發現PowerShell的東西爲好,在這給例如gcm where -All
:
CommandType Name Version Source
----------- ---- ------- ------
Alias where -> Where-Object
Application where.exe 10.0.10... C:\Windows\system32\where.exe
如果您要做想要刪除「標準」別名,請使用Remove-Item alias:where
(如果您希望在PowerShell的每次啓動時完成,可以通過放入配置文件)。
'Get-Command notepad -CommandType Application' – PetSerAl
Get-Command不適用於搜索 –
您可以在powershell中執行where.exe(或任何可執行文件),例如:'&where.exe',例如'&where.exe/R C:\ Windows notepad.exe' –