File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 1
1
import vscode = require( 'vscode' ) ;
2
2
import Window = vscode . window ;
3
- import os = require( 'os' ) ;
4
3
5
4
export function registerOpenInISECommand ( ) : void {
6
5
var disposable = vscode . commands . registerCommand ( 'PowerShell.OpenInISE' , ( ) => {
@@ -10,27 +9,17 @@ export function registerOpenInISECommand(): void {
10
9
11
10
var uri = document . uri
12
11
13
- // For testing, to be removed
14
- Window . showInformationMessage ( uri . fsPath ) ;
15
- Window . showInformationMessage ( uri . path ) ;
16
-
17
- if ( os . arch ( ) == 'x64' ) {
12
+ if ( process . env . hasOwnProperty ( 'PROCESSOR_ARCHITEW6432' ) ) {
18
13
19
14
var ISEPath = 'C:\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell_ise.exe' ;
20
15
21
16
} else
22
17
{
23
18
24
- // Need to figure out how to check OS architecture os.arch returns process architecture
25
- //var ISEPath = process.env.windir + '\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe';
26
- var ISEPath = 'C:\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell_ise.exe' ;
19
+ var ISEPath = process . env . windir + '\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe' ;
27
20
28
21
}
29
-
30
- // For testing, to be removed
31
- Window . showInformationMessage ( os . arch ( ) ) ;
32
- Window . showInformationMessage ( ISEPath ) ;
33
-
22
+
34
23
require ( "child_process" ) . exec ( ISEPath + ' -NoProfile -File ' + uri . fsPath ) . unref ( ) ;
35
24
36
25
You can’t perform that action at this time.
0 commit comments