We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi and thanks for this great package which works perfectly for me when running powershell or cmd processes under Windows.
I am getting troubles when trying to run powershell with command line parameters. It seems that by default, the spawn method sanitize arguments.
So, for instance, if i try to run the following code :
const { platform } = require('os'); const path = require('path'); const Promise = require('promise'); const StatefulProcessCommandProxy = require("stateful-process-command-proxy"); const processCommand = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe' const processArgs = ['-NoProfile', '-ExecutionPolicy bypass'] const statefulProcessCommandProxy = new StatefulProcessCommandProxy( { name: "powershell", max: 5, min: 5, idleTimeoutMS: 10000, logFunction: function(severity,origin,msg) { console.log(' ' + severity.toUpperCase() + " " +origin+" "+ msg); }, processCommand: processCommand, processArgs: processArgs, processRetainMaxCmdHistory : 50, processInvalidateOnRegex : { 'any':[{regex:'.*error.*',flags:'ig'}], 'stdout':[{regex:'.*error.*',flags:'ig'}], 'stderr':[{regex:'.*error.*',flags:'ig'}] }, processCwd : path.join('.', '.'), processEnvMap : null, processUid : null, processGid : null, initCommands: null, validateFunction: (processProxy) => {processProxy.isValid()}, preDestroyCommands: null });
The powershell command which get executed is :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile "-ExecutionPolicy bypass"
Which return an error (Notice the double quotes on the line above which should not be present).
When modifying the following code within processProxy.js, at line 179 :
this._processOptions['windowsVerbatimArguments'] = true;
Powershell start properly with the following command line :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy bypass
Could you handle a parameter so that we can (on win32 platform) handle the spawn parameter windowsVerbatimArguments ?
spawn
I can try to do a pull request if you whish.
Regards
The text was updated successfully, but these errors were encountered:
Handle spawn windowsVerbatimArguments parameter
bc9f5b6
See Issue bitsofinfo#17
No branches or pull requests
Hi and thanks for this great package which works perfectly for me when running powershell or cmd processes under Windows.
I am getting troubles when trying to run powershell with command line parameters.
It seems that by default, the spawn method sanitize arguments.
So, for instance, if i try to run the following code :
The powershell command which get executed is :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile "-ExecutionPolicy bypass"
Which return an error (Notice the double quotes on the line above which should not be present).
When modifying the following code within processProxy.js, at line 179 :
this._processOptions['windowsVerbatimArguments'] = true;
Powershell start properly with the following command line :
Could you handle a parameter so that we can (on win32 platform) handle the
spawn
parameter windowsVerbatimArguments ?I can try to do a pull request if you whish.
Regards
The text was updated successfully, but these errors were encountered: