0
我已經把下列我$PROFILE
:需要一起傳遞函數「別名」參數
function dir
{
Get-ChildItem -Force $args
}
我要的是一個簡單的「目錄」命令,該命令列出所有文件,包括隱藏和系統文件。
但是,只要我傳遞一些參數一起:
dir \ -Directory
我獎勵其次是這個錯誤我的根的完整列表:
Get-ChildItem : Cannot find path 'C:\Users\myuser-Directory' because it does not exist.
我的目的是當然是我的小自制「別名」將擴展到這:
Get-ChildItem -Force \ -Directory
而是「-Directory」get s被視爲字符串文字。我怎樣才能讓我的dir函數按照我想要的方式傳遞參數(而不是字符串數組)?