【发布时间】:2015-07-07 08:32:55
【问题描述】:
如何从命令行向 PowerShell 传递换行符?
// MyScript.ps1:
[CmdletBinding()]
Param(
[Parameter()] $Param
)
Write-Host $Param
// Command line (not PowerShell - cmd.exe!)
powershell.exe -File MyScript.ps1 -Param "First`nSecond"
不起作用。同样使用命令行的换行符\n 也不起作用。那么如何向命令行传递一个新行呢?
【问题讨论】:
标签: powershell powershell-3.0 powershell-4.0