Executing chef commands from third party programs

I have a scenario where I use powershell script run a chef script using chef-apply. I am able to execute this script successfully in powershell. I want to execute this shell script using Nodejs which the present situation demands.

exports.testscript=function(req,res){
var spawn = require(“child_process”).spawn,child;
//var chefcommand = require(‘chef-command’);
//var chefcmd = new chefcommand();
//chefcmd.setExecutable(‘chef-apply’);
child = spawn(“powershell”,[“C:\Users\xyz\chef-repo\script.ps1”],
{windowsVerbatimArguments: true}, {shell: true});
child.stdout.on(“data”,function(data){
console.log("Powershell Data: " + data);
//res.send("Powershell Data: " + data);
});
child.stderr.on(“data”,function(data){
console.log("Powershell Errors: " + data);
});
child.on(“exit”,function(){
console.log(“Powershell Script finished”);
});
child.stdin.end(); //end input
};

I have tried different ways in nodejs using child process but I am getting an error saying ‘chef-apply’ is not recognized as an internal or external command,
operable program or batch file. Is there a way do this.

My script azurepro.rb provisions and bootstraps VM in azure and my final motive is to run “chef-apply azurepro.rb”