Passing new line from command line to PowerShell
How to pass a new line character from the command line to PowerShell?
// MyScript.ps1:
[CmdletBinding()]
Param(
[Parameter()] $Param
)
Write-Host $Param
// Command line (not PowerShell - cmd.exe!)
powershell.exe -File MyScript.ps1 -Param "First`nSecond"
Does not work. Also using command line newline character \n
doesn't work. So how do I pass the newline to the command line?
+3
source to share