这里串
有一些关于Powershell'here-string'的例子,但我很难遇到'here-string'扩展.所以我发布这个有一些帮助.
当你想添加一些带换行符的文字时,单引号和双引号都不需要转义,也不需要换行符"`r`n".'here-strings'在PowerShell中得到了拯救.他们应该从一开始
@"
和换行符应以换行结束
"@
For example: |Result:
|
@" |
Hello world! 09/25/2014 11:39:56 | Hello world! 09/25/2014 11:39:56
'(this will appear as is)' | '(this will appear as is)'
! | !
"@ |
Run Code Online (Sandbox Code Playgroud) 假设您正在 Powershell 4.0 环境中编写脚本,并且希望确保该脚本可以在 Powershell 3.0 中运行。如何确保其向后兼容?