cmder加入PowerShell Core(pwsh.exe)組態

cmder 加入 PowerShell Core(pwsh.exe) 組態

cmder with PowerShell Core

前篇說到,PowerShell Core(pwsh.exe) 目前使用上會有一個視窗跳動的問題,可以改用 cmder 或 Windows Terminal 等其他整合命令環境來解決。因為 cmder 需要其他組態,而 Windows Terminal 差不多是裝好即用,本篇說明 cmder 的相關組態。

過程和 以WSL + Ubuntu + zsh打造Windows上高富帥的命令列模式 裡的 cmder 組態差不多。

開啟 cmder 的 Settings 畫面,選擇 Startup → Tasks 加入以下兩組組態:

  • Name:pwsh::PowerShell
  • icon: /icon "%CMDER_ROOT%\icons\cmder.ico"
  • Commmand:pwsh -WorkingDirectory ~ -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"
  • Name:pwsh::PowerShell as Admin
  • icon: /icon "%CMDER_ROOT%\icons\cmder.ico"
  • Commmand:*pwsh -WorkingDirectory ~ -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""

簡單就把 pwsh.exe 加入 cmder 裡面了,這樣使用 PowerShell Core 才不會讓視窗跳到得老花眼 🙈。

沒有留言:

張貼留言

感謝您的留言,如果我的文章你喜歡或對你有幫助,按個「讚」或「分享」它,我會很高興的。