随着PowerShell Core 6.0.0 的发布,我想开始使用它而不是 Windows 10 的默认 PowerShell。
我目前为此使用 Cmder,它基于 ConEmu。已经有两个 PowerShell 任务,我假设我可以更新它们以指向我本地安装的 PowerShell Core(在 C:\Program Files\PowerShell\6.0.0 中)。
我已经尝试将 Powershell::Powershell 的任务参数更新为以下内容:
/dir "C:\Program Files\PowerShell\6.0.0\" /icon "%CMDER_ROOT%\icons\cmder_blue.ico"
Run Code Online (Sandbox Code Playgroud)
然后我将命令更新为:
"%ProgramFiles%\PowerShell\6.0.0\PowerShell.exe" -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%" -new_console:d:D:\git
Run Code Online (Sandbox Code Playgroud)
但是,它因以下错误而中断:
'c:\program' 不是内部或外部命令,也不是可运行的程序或批处理文件。
我将如何设置 Cmder/ConEmu 来调用 PowerShell 的 PowerShell Core 版本而不是默认安装?
小智 26
用
*pwsh -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9586 次 |
最近记录: |