相关疑难解决方法(0)

在 GitHub 操作中从节点程序运行 Powershell 脚本

嗯,是的,这是一回事。在尝试直接运行 PS 脚本并失败后,让我们尝试从节点脚本运行它的迂回方式,这在 GitHub 操作环境中是合法的。所以经过多次尝试,这是我的最后一个(取自这个答案

var spawn = require("child_process").spawn,child;
var workspace = process.env.GITHUB_WORKSPACE;
var file = workspace + "\\upgrade.ps1";
console.log( "Workspace ", workspace,  " file ", file );
child = spawn("powershell.exe",[ file ]); // more stuff to print output after this
Run Code Online (Sandbox Code Playgroud)

失败了:

Workspace  d:\a\rakudo-star-fix-action\rakudo-star-fix-action  file  d:\a\rakudo-star-fix-action\rakudo-star-fix-action\upgrade.ps1
Powershell Errors: d:\a\rakudo-star-fix-action\rakudo-star-fix-action\upgrade.ps1 : The term 

Powershell Errors: 'd:\a\rakudo-star-fix-action\rakudo-star-fix-action\upgrade.ps1' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the spelling of …
Run Code Online (Sandbox Code Playgroud)

powershell node.js github-actions

3
推荐指数
1
解决办法
356
查看次数

标签 统计

github-actions ×1

node.js ×1

powershell ×1