From 92a42b2d93cc99d8d9c9b8060f251912b23183f8 Mon Sep 17 00:00:00 2001 From: Allan Kimmer Jensen Date: Mon, 10 Apr 2017 14:35:38 +0200 Subject: [PATCH] Fix #94 - Powershell path issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes #94 the powershell path issue by wrapping it with the safe `&(“”)` --- modules/Powershell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Powershell.js b/modules/Powershell.js index 730fd2e..a95c499 100644 --- a/modules/Powershell.js +++ b/modules/Powershell.js @@ -8,7 +8,7 @@ class Powershell { runAsync(pathToScriptFile, parameters) { console.log('Powershell - running: ' + pathToScriptFile + ' ' + parameters); var spawn = require('child_process').spawn; - var child = spawn('powershell.exe', [pathToScriptFile.replace(/ /g,'` '), parameters]); + var child = spawn('powershell.exe', [pathToScriptFile.replace(/(.+)/gi,'&(“$1”)'), parameters]); child.stdout.setEncoding('utf8'); child.stderr.setEncoding('utf8');