Skip to content

Commit 507f365

Browse files
committed
(#259) Utils: pass the -NonInteractive argument
1 parent 193c0b7 commit 507f365

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
99
- [#257](https://github.com/ant-druha/intellij-powershell/pull/257): pass `-NoProfile` to PowerShell when detecting its version, to determine the version faster and avoid possible problems caused by shell customizations
1010

1111
Thanks to @En3Tho for the contribution.
12+
- [#259](https://github.com/ant-druha/intellij-powershell/pull/259): additionally, pass `-NonInteractive` argument
1213

1314
## [2.6.0] - 2024-03-24
1415
### Changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ import com.intellij.plugin.powershell.ide.run.checkExists
88
import com.intellij.plugin.powershell.ide.run.getModuleVersion
99
import com.intellij.plugin.powershell.ide.run.join
1010
import com.intellij.util.io.awaitExit
11-
import kotlinx.coroutines.Dispatchers
12-
import kotlinx.coroutines.async
13-
import kotlinx.coroutines.coroutineScope
11+
import kotlinx.coroutines.*
1412
import kotlinx.coroutines.future.asCompletableFuture
15-
import kotlinx.coroutines.runInterruptible
1613
import java.io.InputStream
1714
import java.util.concurrent.CompletableFuture
1815

@@ -56,7 +53,7 @@ object PSLanguageHostUtils {
5653
private suspend fun readPowerShellVersion(exePath: String): PSVersionInfo {
5754
var process: Process? = null
5855
val commandString = "(\$PSVersionTable.PSVersion, \$PSVersionTable.PSEdition) -join ' '"
59-
val commandLine = GeneralCommandLine(exePath, "–NoProfile", "-Command", commandString)
56+
val commandLine = GeneralCommandLine(exePath, "–NoProfile", "-NonInteractive", "-Command", commandString)
6057
return coroutineScope {
6158
try {
6259
process = commandLine.createProcess()

0 commit comments

Comments
 (0)