我有一个奇怪的问题,试图自动化powershell生产线。
在我的powershell上,它可以工作,但在Jenkins管道下,它总是显示以下错误:
The string is missing the terminator: ".
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString我的代码行:
powershell $mybranch = (get-content F:\software\branchname) -replace '.*?/'; new-Item -ItemType Directory -Force -Path "\\myserver\sw\software\rs\2020-RC1_$branchname"; copy-item -path "E:\Temp\2020-07-22_1.1.1-RC1_$branchname.zip" -destination "\\myserver\sw\software\rs\2020-RC1_$branchname\"发布于 2020-07-22 18:55:51
在… -destination "\\myserver\sw\software\rs\2020-RC1_$branchname\"中,它是双引号前的反斜杠。翻一番。
示例:
powershell -noprofile dir "packages\"字符串缺少终止符:". + CategoryInfo : ParserError:(:) [],ParentContainsErrorRecordException + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
powershell -noprofile dir "packages\\"Directory: D:\bat\packages Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 01.06.2020 10:41 com.company.sft
https://stackoverflow.com/questions/63031054
复制相似问题