Execute PowerShell Script from Grunt

前端 未结 1 1305
一整个雨季
一整个雨季 2021-02-09 04:18

I have a PowerShell script (myScript.ps1) that I need to run as part of my build process. I\'m using Grunt to build my code. I cannot figure out how to run this script from Grun

相关标签:
1条回答
  • 2021-02-09 04:52

    You could give a try to grunt-shell

    Install

    npm install --save-dev grunt-shell
    

    Load

    grunt.loadNpmTasks('grunt-shell');
    

    Configure

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

    Use

    grunt shell:ps
    
    0 讨论(0)
提交回复
热议问题