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.

var spawn = require(“child_process”).spawn,child;
//var chefcommand = require(‘chef-command’);
//var chefcmd = new chefcommand();
child = spawn(“powershell”,[“C:\Users\xyz\chef-repo\script.ps1”],
{windowsVerbatimArguments: true}, {shell: true});
console.log("Powershell Data: " + data);
//res.send("Powershell Data: " + data);
console.log("Powershell Errors: " + data);
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”