大网数据广告活动
Windows排障命令

PowerShell

· 52CE 我爱测

Reference article for the PowerShell command, which opens the PowerShell console from a command prompt.

Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.

Using PowerShell.exe

The PowerShell.exe command-line tool starts a Windows PowerShell session in a Command Prompt window. When you use PowerShell.exe, you can use its optional parameters to customize the session. For example, you can start a session that uses a particular execution policy or one that excludes a Windows PowerShell profile. Otherwise, the session is the same as any session that is started in the Windows PowerShell console.

  • To start a Windows PowerShell session in a Command Prompt window, type PowerShell. A PS prefix is added to the command prompt to indicate that you are in a Windows PowerShell session.

  • To start a session with a particular execution policy, use the ExecutionPolicy parameter, and type:

    PowerShell.exe -ExecutionPolicy Restricted
    
  • To start a Windows PowerShell session without your Windows PowerShell profiles, use the NoProfile parameter, and type:

    PowerShell.exe -NoProfile
    
  • To start a session , use the ExecutionPolicy parameter, and type:

    PowerShell.exe -ExecutionPolicy Restricted
    
  • To see the PowerShell.exe help file, type:

    PowerShell.exe -help
    PowerShell.exe -?
    PowerShell.exe /?
    
  • To end a Windows PowerShell session in a Command Prompt window, type exit. The typical command prompt returns.

Remarks

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 07/11/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。