📅  最后修改于: 2020-11-19 08:01:27             🧑  作者: Mango
反引号(`)运算符也被称作自动换行运算符。它允许多行编写命令。它也可以用于句子中的换行(`n)或制表符(`t)。请参阅以下示例-
Get-Service * | Sort-Object ServiceType `
| Format-Table Name, ServiceType, Status -AutoSize
它将成为
Get-Service * | Sort-Object ServiceType | Format-Table Name, ServiceType, Status -AutoSize
验证输出为
Name ServiceType Status
---- ----------- ------
MSSQLServerADHelper100 Win32OwnProcess Stopped
ntrtscan Win32OwnProcess Running
...
使用换行和制表符。
> Write-host "Title Subtitle"
Title Subtitle
> Write-host "Title `nSubtitle"
Title
Subtitle
> Write-host "Title `tSubtitle"
Title Subtitle