I've been looking around the web and on Stackoverflow but hadn't found an answer to this question. How would you execute a Powershell script from Node.js? The script is on the same server as the Node.js instance.
Node.js – Execute Powershell script from Node.js
node.jspowershell
Related Topic
- Node.js – How to get the path to the current script with Node.js
- PowerShell says “execution of scripts is disabled on this system.”
- Javascript – How to pass command line arguments to a Node.js program
- Node.js + Nginx – What now
- Javascript – How to decide when to use Node.js
- Javascript – the purpose of Node.js module.exports and how do you use it
- Node.js – Using Node.js as a simple web server
- Javascript – How to completely uninstall Node.js, and reinstall from beginning (Mac OS X)
Best Answer
You can just spawn a child process "powershell.exe" and listen to stdout for command output and stderr for errors: