Skip to content

Cannot remove compat layer from session #18

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

Open
ev-dev opened this issue Sep 1, 2021 · 1 comment
Open

Cannot remove compat layer from session #18

ev-dev opened this issue Sep 1, 2021 · 1 comment

Comments

@ev-dev
Copy link

ev-dev commented Sep 1, 2021

Using Remove-Module CompatPowerShellGet does not disable the compatibility mapping features for the PS session. Attempts to run Install-Module after removing the compat module still fails with deprecated warnings.

Recent PS blog post mentions the ability to temporarily bypass the compatibility features of this module.

If you have this compatibility module installed and would not like it to be used, you can remove it from the PowerShell session using the Remove-Module command.

Steps to reproduce:

  • Latest versions of both PowerShellGet and CompatPowerShellGet are installed & available
  • > Install-Module -Name Pansies -AllowClobber (Output: "WARNING: The cmdlet 'Install-Module' is deprecated, please use 'Install-PSResource'.")
  • > Remove-Module -Name CompatPowerShellGet
  • > Install-Module -Name Pansies -AllowClobber (Same output warning, no operation performed)
@jpawlowski
Copy link

jpawlowski commented Jan 16, 2022

Good point!

As PowerShellGet V3 has a few issues right now installing quite a lot famous Microsoft 365 PS modules (Exchange Online, MS Teams, PnP PowerShell, …), it is not possible to use CompatPowerShellGet at the moment. This is due to the fact that to install these modules, one still needs to use the Install-Module command from PowerShellGet V2 until a fix for this was introduced (hopefully as part of v3.0.14-beta, but there is v3.0.13-beta first…).

There is a workaround described here:

Please also note that this compatibility module will not be called if you use fully qualified cmdlets. For example, if you use PowerShellGet\Install-Module this will call a legacy version of PowerShellGet.

However, this workaround does not seem to work. Not sure this is a bug or something I'm doing wrong.

Any hints or tipps what needs to be done, besides not installing CompatPowerShellGet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants