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.

parameters

-File

在 Windows PowerShell ISE 中打开指定的文件。 参数名称 ("-File") 是可选的。 若要列出多个文件,请输入括在引号中的一个文本字符串。 请使用逗号分隔字符串中的文件名。

例如:

PowerShell_ISE -File "File1.ps1,File2.ps1,File3.xml"。

Windows PowerShell 中允许文件名之间的空格,但其他程序(例如 Cmd.exe)可能无法正确解释这些空格。

可以使用此参数打开任何文本文件,包括 Windows PowerShell 脚本文件和 XML 文件。

-Mta

使用多线程单元启动 Windows PowerShell ISE。 此参数是在 Windows PowerShell 3.0 中引入的。 单线程单元 (STA) 是默认设置。

-NoProfile

不运行 Windows PowerShell 配置文件。 默认情况下,Windows PowerShell 配置文件在每个会话中运行。

编写共享内容(例如,将在具有不同配置文件的系统上运行的函数和脚本)时,建议使用此参数。 有关详细信息,请参阅 about_Profiles

-Help -?, /?

显示 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

另请参阅