从 GIthub-actions 运行时 Powershell Invoke-Expression 抛出错误
我正在从 PowerShell 运行 jf.exe,它不起作用并抛出以下错误,尝试了多种方法(在代码中注释),下面似乎没有任何效果,EXE“jf.exe:存在于完全相同的位置
At C:\Program Files\actions-runner\_work\_temp\62db6136-4c6a-45db-9d86-865e38a2797b.ps1:4 char:33
+ "E:\Program Files\JFrog\jf.exe" rt ping
+ ~~
Unexpected token 'rt' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
Error: Process completed with exit code 1.
name: Build
on:
workflow_dispatch
jobs:
build:
name: Build
runs-on: [self-hosted,X64,dev,Windows]
steps:
- uses: actions/checkout@v2
- run: |
# Ping the server
#$cmd = "E:\Program Files\JFrog\jf.exe rt ping"
#Invoke-Expression -Command "& 'E:\Program Files\JFrog\jf.exe' rt ping"
#Invoke-Expression -Command "& '$cmd'"
[string]$JFExe = "E:\Program Files\JFrog\jf.exe"
[Array]$arguments = "rt", "ping"
& $JFExe $arguments
I'm running jf.exe from PowerShell and its not working and throwing below error, have tried multiple ways (commented in the code) below nothing seem to work, the EXE"jf.exe: exists in the exact same location
At C:\Program Files\actions-runner\_work\_temp\62db6136-4c6a-45db-9d86-865e38a2797b.ps1:4 char:33
+ "E:\Program Files\JFrog\jf.exe" rt ping
+ ~~
Unexpected token 'rt' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
Error: Process completed with exit code 1.
name: Build
on:
workflow_dispatch
jobs:
build:
name: Build
runs-on: [self-hosted,X64,dev,Windows]
steps:
- uses: actions/checkout@v2
- run: |
# Ping the server
#$cmd = "E:\Program Files\JFrog\jf.exe rt ping"
#Invoke-Expression -Command "& 'E:\Program Files\JFrog\jf.exe' rt ping"
#Invoke-Expression -Command "& '$cmd'"
[string]$JFExe = "E:\Program Files\JFrog\jf.exe"
[Array]$arguments = "rt", "ping"
& $JFExe $arguments
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论