Answers for "run script in powershell"

PHP
2

cmd run powershell command

powershell -ExecutionPolicy Bypass -Command "your script here"
Posted by: Guest on November-12-2020
0

javascript execute powershell script

var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:\\temp\\helloworld.ps1"]);
child.stdout.on("data",function(data){
    console.log("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
Posted by: Guest on March-22-2020
6

powershell script run

./myscript.ps1  //if is in the current directory
c:/scripts/myscript.ps1  //if you want to use the full path
&"C:/my path with space/myscript.ps1"  //if your path has spaces
Posted by: Guest on February-05-2020

Code answers related to "run script in powershell"

Browse Popular Code Answers by Language