Skip to content

Commit 6a3f7c9

Browse files
rjmholtTylerLeonhardt
authored andcommitted
Get the latest PSReadLine module installed
1 parent 3575c79 commit 6a3f7c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PowerShellEditorServices/Session/PSReadLinePromptContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ internal class PSReadLinePromptContext : IPromptContext {
2929
[System.Diagnostics.DebuggerStepThrough()]
3030
param()
3131
end {
32-
$module = Get-Module -ListAvailable PSReadLine | Select-Object -First 1
33-
if (-not $module -or $module.Version -lt ([version]'2.0.0')) {
32+
$module = Get-Module -ListAvailable PSReadLine | Where-Object Version -ge '2.0.0' | Sort-Object -Descending Version | Select-Object -First 1
33+
if (-not $module) {
3434
return
3535
}
3636

0 commit comments

Comments
 (0)