我有一个PowerShell脚本(myScript.ps1),需要作为构建过程的一部分运行。我正在使用Grunt构建我的代码。我不知道如何从Grunt运行这个脚本。有人知道如何从Grunt运行PowerShell脚本,以便在PowerShell脚本完成之前不会运行下一个任务吗?
谢谢!
你可以试着咕哝外壳
安装
npm install --save-dev grunt-shell
加载
grunt.loadNpmTasks('grunt-shell');
配置
grunt.initConfig({
shell: {
ps: {
options: {
stdout: true
},
command: 'powershell myScript.ps1'
}
}
});
使用
grunt shell:ps