【发布时间】:2018-10-04 14:06:15
【问题描述】:
我正在从批处理文件中调用 powershell 脚本
powershell createshortcut.ps1 "%~n0"
但是,如果参数有单引号(扩展示例)
powershell createshortcut.ps1 "Divertirsi con l'ortografia"
解析器会抛出错误
The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
显然参数的内容是未知的。
Powershell 版本:
Major Minor Build Revision
----- ----- ----- --------
5 1 14393 2189
【问题讨论】:
标签: powershell