在 macOS 上安裝 PowerShell
這篇基本上沒啥技術價值, 只是沒想到自己會有在 macOS 上安裝 PowerShell 的這一天. 純紀錄之...
專案需求中需編寫些較為複雜的 PowerShell 腳本, 在 Windows 環境下開發了一會有些不習慣, 印象中 PowerShell Open Source 後有發行 macOS/Linux 版. 所以在 macOS 上安裝了 PowerShell 來測試腳本.
Homebrew
微軟官方文件有提供幾種方法來安裝 PowerShell, 選擇最無腦的 Homebrew.
$ brew install --cask powershell
安裝後確認是否可執行:
$ pwsh
See also
安裝完成後, 若需修改與配置環境或使用者設定檔, 官網有說明與介紹, 前往參考: 在 macOS 上安裝 PowerShell - PowerShell | Microsoft Docs