Skip to content

Commit 7ca40cc

Browse files
committed
Escape backslash when specifying a path for powershell_ise.exe
1 parent 08abb2d commit 7ca40cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/features/OpenInISE.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export function registerOpenInISECommand(): void {
2323
//process = require('child_process');
2424
//var filePath = convertUriToPath(editor.document.uri);
2525
var filePath = 'C:\temp\Get-ProductKey.ps1'
26-
require("child_process").exec("powershell_ise.exe -NoProfile -File C:\temp\Get-ProductKey.ps1").unref();
26+
//require("child_process").exec('powershell_ise.exe -NoProfile -File "C:\\temp\\Get-ProductKey.ps1"').unref();
27+
require("child_process").exec(process.env.windir + '\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe -NoProfile -File "C:\\temp\\Get-ProductKey.ps1"').unref();
28+
2729

2830
});
2931
}

0 commit comments

Comments
 (0)