Skip to content

Lock bundled modules (especially PSReadLine) #1493

Closed

Description

Per PowerShell/vscode-powershell#3385 users can encounter incompatibility issues by installing newer versions of our dependencies since we do not lock PSES to the bundled version. This is unfortunate and causes more issues than we believe are fixed by picking up the latest installed version. We are going to change PSES to only load the bundled module so that we, the developers, can manually update and test our dependencies. In dire scenarios, users can still just overwrite the bundled module in the extension folder, and at that point will either be following our specific instructions for a workaround or going outside our supported scenarios.

private static readonly string ReadLineInitScript = $@"
[System.Diagnostics.DebuggerHidden()]
[System.Diagnostics.DebuggerStepThrough()]
param()
end {{
$module = Get-Module -ListAvailable PSReadLine |
Where-Object {{ $_.Version -ge '2.0.2' }} |
Sort-Object -Descending Version |
Select-Object -First 1
if (-not $module) {{
Import-Module '{_psReadLineModulePath.Replace("'", "''")}'
return [Microsoft.PowerShell.PSConsoleReadLine]
}}
Import-Module -ModuleInfo $module
return [Microsoft.PowerShell.PSConsoleReadLine]
}}";

Activity

  1. ghost added
    Needs: TriageMaintainer attention needed!
    on Jun 1, 2021
  2. andyleejordan commented on Jun 3, 2021

    @andyleejordan
    MemberAuthor

    When 2.2.0 is released, we should (of course) upgrade the bundled extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions