Windows PowerShell ISE

Windows PowerShell 整合式腳本環境 (ISE) 是 Windows PowerShell 的主應用程式。 在 ISE 中,您可以在單一 Windows 圖形使用者介面中執行命令及撰寫、測試和偵錯腳本。 ISE 提供多行編輯、索引標籤自動完成、語法著色、選擇性執行、內容相關說明,以及從右至左語言的支援。 功能表項和鍵盤快捷方式會對應到您在 Windows PowerShell 控制台中執行的許多相同工作。 例如,當您在 ISE 中偵錯文本時,可以在編輯窗格中以滑鼠右鍵按兩下程式代碼行,以設定斷點。

支援

ISE 最初是透過 Windows PowerShell V2 引進,並使用 PowerShell V3 重新設計。 所有支援的 Windows PowerShell 版本都支援 ISE,包括 Windows PowerShell V5.1。

注意

PowerShell ISE 已不再處於作用中的功能開發中。 作為 Windows 的出貨元件,它仍會繼續正式支援安全性和高優先順序的服務修正。 我們目前沒有從 Windows 移除 ISE 的計劃。

PowerShell v6 和之後不支援 ISE。 想要取代 ISE 的用戶應該使用 Visual Studio Code 搭配 PowerShell 擴充功能

主要功能

Windows PowerShell ISE 的主要功能包括:

  • 多行編輯:若要在 [命令] 窗格中的目前行下插入空白行,請按 SHIFT+ENTER。
  • 選擇性執行:若要執行腳本的一部分,請選取您要執行的文字,然後按兩下 [ 執行腳稿 ] 按鈕。 或者,按 F5
  • 上下文相關說明:輸入 Invoke-Item,然後按 F1。 說明檔會開啟至 Cmdlet 的文章 Invoke-Item

Windows PowerShell ISE 可讓您自定義其外觀的某些層面。 它也有自己的 Windows PowerShell 配置文件腳本。

啟動 Windows PowerShell ISE

單擊 [ 開始],選取 [Windows PowerShell],然後按兩下 [ Windows PowerShell ISE]。 或者,您可以在任何命令殼層或 [執行] 方塊中輸入 powershell_ise.exe

在 Windows PowerShell ISE 中取得說明

在 [ 說明] 功能表上,按兩下 [Windows PowerShell 說明]。 或者,按 F1。 開啟的檔案描述 Windows PowerShell ISE 和 Windows PowerShell,包括 Cmdlet 中 Get-Help 提供的所有說明。