若要啟動 Windows PowerShell,您可以從 [開始] 功能表、[工作列]、[搜尋] 或 [執行] 方塊、[命令提示] 視窗,甚至是其他的 Windows PowerShell 視窗。

此外,也可以在單一電腦上啟動多個 Windows PowerShell (或 Windows PowerShell ISE) 執行個體。

如何啟動 Windows PowerShell

在 Windows Vista、Windows Server 2008 和較新版本的 Windows 上,從 [開始] 功能表,依序按一下 [開始]、[所有程式]、[附屬應用程式]、[Windows PowerShell] 資料夾,然後按一下 [Windows PowerShell] 項目,即可啟動 Windows PowerShell。

若要在 Windows XP 與 Windows Server 2003 上啟動 Windows PowerShell,從 [開始] 功能表,依序按一下 [開始]、[程式集]、[附屬應用程式]、[Windows PowerShell] 資料夾,然後按一下 [Windows PowerShell] 項目。

如何啟動 Windows PowerShell ISE

Windows PowerShell 整合式指令碼環境 (ISE) 是一個全新的主控應用程式,可以讓您在好用的語法著色環境中,執行命令並且撰寫、測試和偵錯指令碼。

在 Windows Vista、Windows Server 2008 和較新版本的 Windows 中,從 [開始] 功能表,依序按一下 [開始]、[所有程式]、[附屬應用程式]、[Windows PowerShell] 資料夾,然後按一下 [Windows PowerShell ISE] 項目,即可啟動 Windows PowerShell ISE。

若要在 Windows XP 與 Windows Server 2003 中啟動 Windows PowerShell,從 [開始] 功能表,依序按一下 [開始]、[程式集]、[附屬應用程式]、[Windows PowerShell] 資料夾,然後按一下 [Windows PowerShell ISE] 項目。

如何與所有模組一併啟動 Windows PowerShell

在 Windows 7 和 Windows Server 2008 R2 中,您可以使用工作啟動包含所有可用命令的 Windows PowerShell 視窗,這些命令涵蓋選擇性模組、嵌入式管理單元,包括預設不一定會加入的項目。該視窗也有您的系統管理員帳戶權限。

如需 Windows PowerShell 模組、嵌入式管理單元的詳細資訊,請參閱使用模組和嵌入式管理單元如何匯入模組about_Modules

若要連同所有模組啟動 Windows PowerShell,請使用下列其中一種方式。

  • 在工作列中,以滑鼠右鍵按一下 [Windows PowerShell] 圖示,然後按一下 [匯入所有模組]。

按一下 [開始] 功能表中的 [系統管理工具],然後按一下 [Windows PowerShell 模組]。

附註:

在 Windows Server 2008 R2 中,Windows PowerShell 圖示預設會固定出現在工作列中。不過,您必須先啟動一次 Windows PowerShell,才會出現 [匯入所有模組] 工作。

在其他支援的 Windows 版本中,您可以將所有可用的模組加入至 Windows PowerShell 工作階段。啟動 Windows PowerShell,然後在 Windows PowerShell 提示字元中輸入:

get-module -listAvailable | import-module

如何以系統管理員權限啟動 Windows PowerShell

在 Windows 7 和 Windows Server 2008 R2 中,可以透過工作以所有 [系統管理員] 帳戶的權限啟動 Windows PowerShell。通常這並不必要,但是仍然有幾個需要這類權限的命令。

在 Windows 工作列中,以滑鼠右鍵按一下 [Windows PowerShell] 圖示,然後按一下 [以系統管理員身分執行 Windows PowerShell]。

若要在所有支援的 Windows 版本上以系統管理員權限啟動 Windows PowerShell (或 Windows PowerShell ISE),請使用下列程序。

  1. 依序按一下 [開始]、[所有程式] 和 [附屬應用程式],然後按一下 [Windows PowerShell] 資料夾。

  2. 以滑鼠右鍵按一下 [Windows PowerShell] 項目 (或 [Windows PowerShell ISE] 項目),然後按一下 [以系統管理員身分執行]。

如何與其他選項一併啟動 Windows PowerShell

Windows PowerShell 擁有多個可以讓您啟動自訂 Windows PowerShell 工作階段的選項,這些選項包括使用特定主控台檔案、以特定執行原則執行、排除 Windows PowerShell 設定檔、執行特定命令或指令碼或者使用單一執行緒 Apartment 等其他多種項目。

若要查看這些選項,請在 [命令提示字元] (Cmd.exe) 視窗或現存的 Windows PowerShell 視窗中,輸入:

powershell -?

若要連同某一特定選項啟動 Windows PowerShell,請使用該選項的參數。例如,若要啟動具有 RemoteSigned 執行原則的 Windows PowerShell,請輸入:

powershell -executionPolicy RemoteSigned




目錄