I am attempting to run a powershell script through the system command. This is the code I am using
status = system("start powershell.exe Set-ExecutionPolicy RemoteSigned \n");
status = system("start powershell.exe D:\\foo\\tempFilePShellCommand.ps1 > D:\\foo\\MyFile.txt");
Now the problem with the above code is that MyFile.txt gets created but its empty. If I run the file through powershell the file gets created and contains the correct data. Any suggestions on why the file is empty and how I can fix this /