Open ev-dev opened 2 years ago
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
?
Using
Remove-Module CompatPowerShellGet
does not disable the compatibility mapping features for the PS session. Attempts to runInstall-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.
Steps to reproduce:
> 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)