【发布时间】:2014-02-11 09:41:56
【问题描述】:
有没有办法排除冒号(:),这样就可以通过参数把它打印成String?
小例子:
PowerShellTest.ps1:
param (
[string]$message="Error: No message defined!"
);
"Info: Test-Information"
$message;
如果您现在通过 powershell 启动此脚本:
powershell.exe D:\PowerShellTest.ps1 -message "Error: Test-Error"
现在你只得到输出字符串Error:,其余的将被截断
我该怎么做才能得到整个字符串Error: Test-Error?
【问题讨论】:
标签: powershell scripting