在本機安裝 PowerShell

了解如何在本機安裝 PowerShell,在自己的電腦上解 Exercism 的練習


PowerShell 語言學習軌道需求

Exercism 的 PowerShell 語言學習軌道要求你的系統必須安裝:

  • PowerShell 或 Windows PowerShell Core
  • 已安裝 Pester 測試與模擬框架模組

(附註:PowerShell 的支援僅限於重大修正。PowerShell Core 持續維護,且跨平台支援更完整)

安裝 PowerShell

從 Windows 7 SP1 起,所有 Windows 作業系統都預先安裝了 PowerShell。

你可以在這裡找到最新版的 PowerShell,以及所有平台(Linux、macOS 與 Windows)的安裝說明。

你也可以取得 PowerShell 的原始碼與手動安裝方式。

安裝與更新 Pester 框架

Pester 是 PowerShell 的測試框架。 從 4.0.9 版起,它與 Windows、Linux 和 MacOS 上的 PowerShell Core 相容(但有一些限制)。

Windows 10 已預先安裝它,不過建議你執行下列 PowerShell 指令來更新:

Install-Module -Name Pester -Force -SkipPublisherCheck

之後要更新時,請執行:

Update-Module -Name Pester

如有需要,更多安裝說明請見:https://github.com/pester/Pester/wiki/Installation-and-Update

使用 IDE

如果你想要功能更完整的編輯體驗,你可能會想使用 IDE。 以下是支援建置 PowerShell 專案、最受歡迎的 IDE:

所有平台