将Powershell脚本组合在一起,我似乎得到了与dir (Get-ChildItem cmdlet)的-Directory开关不一致的行为。如果我运行一个常规的Powershell实例并输入dir -Directory,它就能正常工作。但是,当我把它放在一个.ps1文件中并运行它时,我得到的结果是: Get-ChildItem : A parameter cannot be found that matches parameter name我使用的
我已经在下面的powershell脚本上尝试过$fullProfile = (Get-ChildItem问题似乎是配置文件上的一些目录具有长路径,并且get-ChildItem失败
Get-ChildItem : The specified path, file name, or both are tooAt C:\scripts\powershell\profiles.ps1: