File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
src/PowerShellEditorServices/Session Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,25 @@ task RestorePsesModules -After Build {
309
309
310
310
Save-Module @splatParameters
311
311
}
312
+
313
+ # TODO: Replace this with adding a new module to Save when a new PSReadLine release comes out to the Gallery
314
+ if (-not (Test-Path $PSScriptRoot / module/ PSReadLine))
315
+ {
316
+ Write-Host " `t Installing module: PSReadLine"
317
+
318
+ # Download AppVeyor zip
319
+ $jobId = (Invoke-RestMethod https:// ci.appveyor.com / api/ projects/ lzybkr/ PSReadLine).build.jobs[0 ].jobId
320
+ Invoke-RestMethod https:// ci.appveyor.com / api/ buildjobs/ $jobId / artifacts/ bin% 2FRelease% 2FPSReadLine.zip - OutFile $PSScriptRoot / module/ PSRL
321
+
322
+ # Position PSReadLine
323
+ Expand-Archive $PSScriptRoot / module/ PSRL.zip $PSScriptRoot / module/ PSRL
324
+ Move-Item $PSScriptRoot / module/ PSRL/ PSReadLine $PSScriptRoot / module
325
+
326
+ # Clean up
327
+ Remove-Item - Force - Recurse $PSScriptRoot / module/ PSRL.zip
328
+ Remove-Item - Force - Recurse $PSScriptRoot / module/ PSRL
329
+ }
330
+
312
331
Write-Host " `n "
313
332
}
314
333
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ internal class PSReadLinePromptContext : IPromptContext {
29
29
[System.Diagnostics.DebuggerStepThrough()]
30
30
param()
31
31
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) {
34
34
return
35
35
}
36
36
You can’t perform that action at this time.
0 commit comments