共用方式為


about_PowerShell_Ise_exe

簡短描述

說明如何使用命令行工具PowerShell_Ise.exe。

詳細描述

PowerShell_Ise.exe啟動 Windows PowerShell 整合式腳本環境 (ISE) 會話。 您可以在 Cmd.exe 和 Windows PowerShell 中執行它。

若要執行PowerShell_ISE.exe,請輸入 PowerShell_ISE.exe、PowerShell_ISE 或 ISE。

語法

PowerShell_Ise[.exe]
PowerShell_ISE[.exe]
ISE[.exe]
[-File]<FilePath[]> [-NoProfile] [-MTA]
-Help | ? | -? | /? Displays the syntax and describes the command-line switches.

參數

-檔

在 Windows PowerShell ISE 中開啟指定的檔案。 參數名稱 (“-File”) 是選擇性的。 若要列出多個檔案,請輸入一個以引弧括住的文字字串。 使用逗號分隔字串內的檔名。

例如:

PowerShell_ISE -File “File1.ps1,File2.ps1,File3.xml”。

Windows PowerShell 中允許檔名之間的空格,但可能無法由其他程序正確解譯,例如Cmd.exe。

您可以使用此參數來開啟任何文本檔,包括 Windows PowerShell 腳本檔案和 XML 檔案。

-Mta

使用多線程 Apartment 啟動 Windows PowerShell ISE。 此參數是在 Windows PowerShell 3.0 中引進的。 單個線程 Apartment (STA) 是預設值。

-NoProfile

不會執行 Windows PowerShell 配置檔。 根據預設,Windows PowerShell 配置檔會在每一個會話中執行。

當您撰寫共用內容時,建議您使用此參數,例如將在具有不同配置檔的系統上執行的函式和腳本。 如需詳細資訊,請參閱 about_Profiles

-説明-?/?

顯示PowerShell_ISE.exe的說明。

範例

這些命令會啟動 Windows PowerShell ISE。 命令是相等的,而且可以交替使用。

PS C:> PowerShell_ISE.exe
PS C:> PowerShell_ISE
PS C:> ISE

這些命令會在 Windows PowerShell ISE 中開啟 Get-Profile.ps1 腳本。 命令是相等的,而且可以交替使用。

PS C:> PowerShell_ISE.exe -File .\Get-Profile.ps1
PS C:> ISE -File .\Get-Profile.ps1
PS C:> ISE .\Get-Profile.ps1

此命令會在 Windows PowerShell ISE 中開啟 Get-Backups.ps1 和 Get-BackupInstance.ps1 腳本。 若要開啟多個檔案,請使用逗號分隔檔名,並以引號括住整個檔名值。

PS C:> ISE -File ".\Get-Backups.ps1,Get-BackupInstance.ps1"

此命令會啟動沒有配置檔的 Windows PowerShell ISE。

PS C:> ISE -NoProfile

此命令會取得PowerShell_ISE.exe的說明。

PS C:> ISE -help

另請參閱