Skip to content

Commit 0eb3c03

Browse files
committed
Load only bundled PSReadLine
1 parent 1d23364 commit 0eb3c03

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Diff for: src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs

+2-10
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,13 @@ internal class PSReadLinePromptContext : IPromptContext
2424
"..",
2525
"PSReadLine");
2626

27+
# TODO: Does this have to be done in an inline script?
2728
private static readonly string ReadLineInitScript = $@"
2829
[System.Diagnostics.DebuggerHidden()]
2930
[System.Diagnostics.DebuggerStepThrough()]
3031
param()
3132
end {{
32-
$module = Get-Module -ListAvailable PSReadLine |
33-
Where-Object {{ $_.Version -ge '2.0.2' }} |
34-
Sort-Object -Descending Version |
35-
Select-Object -First 1
36-
if (-not $module) {{
37-
Import-Module '{_psReadLineModulePath.Replace("'", "''")}'
38-
return [Microsoft.PowerShell.PSConsoleReadLine]
39-
}}
40-
41-
Import-Module -ModuleInfo $module
33+
Import-Module '{_psReadLineModulePath.Replace("'", "''")}'
4234
return [Microsoft.PowerShell.PSConsoleReadLine]
4335
}}";
4436

0 commit comments

Comments
 (0)