stateful-process-command-proxy icon indicating copy to clipboard operation
stateful-process-command-proxy copied to clipboard

Handling child_process.spawn() parameter "windowsVerbatimArguments"

Open rebrec opened this issue 5 years ago • 0 comments

Here is a basic implementation which solve the following issue :

https://github.com/bitsofinfo/stateful-process-command-proxy/issues/17

TLDR : Under Windows, child_process.spawn() method escape process arguments and add quotes to them. This can lead to improper parameter handling by the called process.

Example: If we pass the following processCommand and processArgs parameters to the StatefulProcessCommandProxy

const processCommand = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'
const processArgs = ['-NoProfile -ExecutionPolicy bypass']

This pull request provide a new parameter to ProcessProxy to handle this.

rebrec avatar Dec 26 '19 14:12 rebrec