且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Grunt执行PowerShell脚本

更新时间:2022-12-02 18:33:06

您可以尝试 grunt-shell

安装

npm install --save-dev grunt-shell

加载

Load

grunt.loadNpmTasks('grunt-shell');

配置

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

使用

grunt shell:ps