From 37792758801e9067312d5f7fbd95a9c241bb55c1 Mon Sep 17 00:00:00 2001 From: Rob Holt Date: Fri, 22 Nov 2019 18:43:38 -0800 Subject: [PATCH 1/2] Change startup for binary PSES cmdlet --- src/process.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.ts b/src/process.ts index 051da88488..a08d158504 100644 --- a/src/process.ts +++ b/src/process.ts @@ -41,11 +41,11 @@ export class PowerShellProcess { return new Promise( (resolve, reject) => { try { - const startScriptPath = + const psesModulePath = path.resolve( __dirname, this.bundledModulesPath, - "PowerShellEditorServices/Start-EditorServices.ps1"); + "PowerShellEditorServices/PowerShellEditorServices.psd1"); const editorServicesLogPath = this.log.getLogFilePath(logFileName); @@ -73,9 +73,9 @@ export class PowerShellProcess { powerShellArgs.push("-ExecutionPolicy", "Bypass"); } - const startEditorServices = "& '" + - PowerShellProcess.escapeSingleQuotes(startScriptPath) + - "' " + this.startArgs; + const startEditorServices = "Import-Module '" + + PowerShellProcess.escapeSingleQuotes(psesModulePath) + + "'; Start-EditorServices " + this.startArgs; if (utils.isWindowsOS()) { powerShellArgs.push( @@ -108,7 +108,7 @@ export class PowerShellProcess { this.log.write( "Language server starting --", " exe: " + powerShellExePath, - " args: " + startScriptPath + " " + this.startArgs); + " args: " + startEditorServices); // Make sure no old session file exists utils.deleteSessionFile(this.sessionFilePath); From ac1070f5f9095827552e8604c62a4b9c2faed533 Mon Sep 17 00:00:00 2001 From: Rob Holt Date: Fri, 22 Nov 2019 18:43:38 -0800 Subject: [PATCH 2/2] Change startup for binary PSES cmdlet --- src/process.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.ts b/src/process.ts index d3d9a660ca..aefcd451f1 100644 --- a/src/process.ts +++ b/src/process.ts @@ -41,11 +41,11 @@ export class PowerShellProcess { return new Promise( (resolve, reject) => { try { - const startScriptPath = + const psesModulePath = path.resolve( __dirname, this.bundledModulesPath, - "PowerShellEditorServices/Start-EditorServices.ps1"); + "PowerShellEditorServices/PowerShellEditorServices.psd1"); const editorServicesLogPath = this.log.getLogFilePath(logFileName); @@ -73,9 +73,9 @@ export class PowerShellProcess { powerShellArgs.push("-ExecutionPolicy", "Bypass"); } - const startEditorServices = "& '" + - PowerShellProcess.escapeSingleQuotes(startScriptPath) + - "' " + this.startArgs; + const startEditorServices = "Import-Module '" + + PowerShellProcess.escapeSingleQuotes(psesModulePath) + + "'; Start-EditorServices " + this.startArgs; if (utils.isWindows) { powerShellArgs.push( @@ -108,7 +108,7 @@ export class PowerShellProcess { this.log.write( "Language server starting --", " exe: " + powerShellExePath, - " args: " + startScriptPath + " " + this.startArgs); + " args: " + startEditorServices); // Make sure no old session file exists utils.deleteSessionFile(this.sessionFilePath);