2020-10-19 18:17:12 +01:00
|
|
|
# powershell
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 专为系统管理而设计的命令行 shell 和脚本语言。
|
2022-10-04 16:06:23 +01:00
|
|
|
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/powershell>.
|
2020-10-19 18:17:12 +01:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 在命令提示符窗口中启动 Windows PowerShell 会话:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 加载一个特定的 PowerShell 控制台文件:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -PSConsoleFile {{路径/file}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 用指定版本的 PowerShell 启动会话:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -Version {{版本}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 防止运行启动命令后 shell 退出:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -NoExit`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 描述发送到 PowerShell 的数据格式:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -InputFormat {{Text|XML}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 设定 PowerShell 输出的格式:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -OutputFormat {{Text|XML}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示帮助:
|
2020-10-19 18:17:12 +01:00
|
|
|
|
|
|
|
`powershell -Help`
|