我需要在github 工作流中安装 Visual Studio Code 的扩展。我想在工作流中运行这个命令:
run: C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al
但是,github runner 不喜欢这样:
Run C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dynamics-smb.al
C:\Program: D:\a\_temp\e14dee42-ae33-48ac-ad4e-44f4e4600de5.ps1:2
Line |
2 | C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dy …
| ~~~~~~~~~~
| The term 'C:\Program' is not recognized as a name of a cmdlet, function, script file, or executable
| program. Check the spelling of the name, or if a path was included, verify that the path is correct
| and try again.
我尝试了以下变体,但一切都失败了:
run "C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dynamics-smb.al"
--> Invalid workflow file
run "C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al"
--> The term 'C:/Program' is not recognized as a name of a cmdlet...
run 'C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al'
--> The term 'C:/Program' is not recognized as a name of a cmdlet...
run \"C:/Program Files/Microsoft VS Code/code.exe\" --install-extension ms-dynamics-smb.al
--> The term '\C:/Program Files/Microsoft VS Code/code.exe\' is not recognized...
如何在 github 工作流文件中正确处理/转义带有空格的路径?
怎么样
run: |
"C:/Program Files/Microsoft VS Code/code.exe" --install-extension ms-dynamics-smb.al
所以你使用 YAML 块而不是引用单词?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句