Skip to content

Commit c0ab493

Browse files
committed
(#79) PSLanguageHostUtils: fix the quote passing issue
For details, see https://stackoverflow.com/a/59681993/2684760
1 parent ac2c2de commit c0ab493

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/PSLanguageHostUtils.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.intellij.plugin.powershell.lang.lsp.languagehost
33
import com.intellij.execution.configurations.GeneralCommandLine
44
import com.intellij.openapi.application.PathManager
55
import com.intellij.openapi.diagnostic.Logger
6-
import com.intellij.openapi.util.SystemInfo
76
import com.intellij.plugin.powershell.ide.PluginAppRoot
87
import com.intellij.plugin.powershell.ide.run.checkExists
98
import com.intellij.plugin.powershell.ide.run.getModuleVersion
@@ -56,8 +55,7 @@ object PSLanguageHostUtils {
5655

5756
private suspend fun readPowerShellVersion(exePath: String): PSVersionInfo {
5857
var process: Process? = null
59-
val qInner = if (SystemInfo.isWindows) '\'' else '"'
60-
val commandString = "(\$PSVersionTable.PSVersion, \$PSVersionTable.PSEdition) -join $qInner $qInner"
58+
val commandString = "(\$PSVersionTable.PSVersion, \$PSVersionTable.PSEdition) -join ' '"
6159
val commandLine = GeneralCommandLine(exePath, "-command", commandString)
6260
return coroutineScope {
6361
try {

0 commit comments

Comments
 (0)