将Powershell参数传递到批处理文件中

时间:2016-06-03 06:23:31

标签: powershell batch-file

我正在尝试将PowerShell中的环境参数传递到批处理文件中,因此它会调用正确的XML来用于部署。

PowerShell脚本:

@echo off
CD /D "C:\Deployment\Install\DeployScripts"
echo Deployment will now start
cscript deploy.vbs ..\DeploymentXml\%Deploymentxml%.xml

它仍会调用批处理文件,但不会传递参数。

批处理文件:

document.addEventListener('deviceready', function () {
    cordova.plugins.email.isAvailable(
        function (isAvailable) {

            window.plugin.email.open({
                to:      'test@test.com',
                subject: 'Greetings',
                body:    'How are you? Nice greetings from Leipzig'
           }, callback, scope);
        }
    );
}, false);

function callback(){
    console.log("callback function");
}

function scope(){
    console.log("scope function");
}

1 个答案:

答案 0 :(得分:0)

如果我只是将批处理文件更改为1就可以了

@echo off
CD /D "C:\Deployment\Install\DeployScripts"
echo Deployment will now start
cscript deploy.vbs ..\DeploymentXml\%l%.xml