The following I can run in the command Prompt with no problem:
powershell -noexit "& ""C:\wamp\www\mypowersher.ps1”""
But I want to add it to my PHP script. Is it possible?
I tried using exec but it did not work.
$psPath ='"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"';
$psDIR = 'C:\\wamp\\www\\mypowersher.ps1';
$psScript = 'mypowersher.ps1';
$runScript = $psDIR. $psScript;
$runCMD = $psPath." "& ".$runScript." 2>&1"";
exec( $runCMD);