Skip to content

Lock bundled modules (especially PSReadLine) #1493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andyleejordan opened this issue Jun 1, 2021 · 1 comment · Fixed by #1514
Closed

Lock bundled modules (especially PSReadLine) #1493

andyleejordan opened this issue Jun 1, 2021 · 1 comment · Fixed by #1514
Assignees
Labels
Area-ReadLine Issue-Enhancement A feature request (enhancement).

Comments

@andyleejordan
Copy link
Member

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]
}}";

@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-ReadLine labels Jun 1, 2021
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 1, 2021
@andyleejordan
Copy link
Member Author

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
Labels
Area-ReadLine Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant