Skip to content

Commit faa5e33

Browse files
committed
Changed to using require("child_process") for launching external process
1 parent fcbac28 commit faa5e33

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/features/OpenInISE.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
import vscode = require('vscode');
22
import Window = vscode.window;
33

4+
5+
/**
46
function convertUriToPath(Uri) {
57
8+
window.showInformationMessage(Uri)
69
var result = Uri.replace("file://","")
710
var result = result.replace("/","\")
811
var driveletter = result.substring(0)
912
var result = driveletter + ":" + result.substring(1,-1)
1013
1114
}
15+
*/
1216

1317
export function registerOpenInISECommand(): void {
1418
var disposable = vscode.commands.registerCommand('PowerShell.OpenInISE', () => {
1519

1620
var editor = Window.activeTextEditor;
1721
var document = editor.document;
1822

19-
process = require('child_process');
20-
var filePath = convertUriToPath(editor.document.uri);
21-
process.exec("powershell_ise.exe -NoProfile -File " + filePath);
23+
//process = require('child_process');
24+
//var filePath = convertUriToPath(editor.document.uri);
25+
var filePath = 'C:\temp\Get-ProductKey.ps1'
26+
require("child_process").exec("powershell_ise.exe -NoProfile -File " + filePath).unref();
2227

2328
});
2429
}

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export function activate(context: vscode.ExtensionContext): void {
101101
// Register other features
102102
registerExpandAliasCommand(languageServerClient);
103103
registerShowHelpCommand(languageServerClient);
104-
registerOpenInISECommand(languageServerClient);
105104
registerConsoleCommands(languageServerClient);
106105
}
107106

0 commit comments

Comments
 (0)