繁体   English   中英

从Grunt执行PowerShell脚本

[英]Execute PowerShell Script from Grunt

我有一个PowerShell脚本(myScript.ps1),我需要在构建过程中运行它。 我正在使用Grunt来构建我的代码。 我无法弄清楚如何从Grunt运行这个脚本。 有谁知道如何从Grunt运行PowerShell脚本,以便在PowerShell脚本完成之前下一个任务不会运行?

谢谢!

你可以尝试一下grunt-shell

安装

npm install --save-dev grunt-shell

加载

grunt.loadNpmTasks('grunt-shell');

配置

grunt.initConfig({
    shell: {
        ps: {
            options: {
                stdout: true
            },
            command: 'powershell myScript.ps1'
        }
    }
});

采用

grunt shell:ps

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM