PowerShell / PowerShellGet

This module provide functions used with PowerShellGet v3 to provide compatibility with scripts expecting PowerShellGet v2
MIT License
49 stars 13 forks source link

Error when I import PowerShellGet 3.0.23: New-Alias: The alias is not allowed, because an alias with the name 'fimo' already exists #56

Open nbdinara opened 8 months ago

nbdinara commented 8 months ago

Prerequisites

Steps to reproduce

I am running command: Import-Module PowerShellGet -MinimumVersion 3.0.23 -Scope Global -Force

I see errors: New-Alias: The alias is not allowed, because an alias with the name 'fimo' already exists. New-Alias: The alias is not allowed, because an alias with the name 'inmo' already exists. New-Alias: The alias is not allowed, because an alias with the name 'pumo' already exists. New-Alias: The alias is not allowed, because an alias with the name 'upmo' already exists.

It looks like that conflict is happening because the same aliases exist in 2.2.5 and 3.0.23 versions of PowerShellGet. Should I not install PowerShellGet 3.0.23 until PowerShell 7.4 will be released?

Expected behavior

Module is loaded without errors

Actual behavior

New-Alias: The alias is not allowed, because an alias with the name 'fimo' already exists.
New-Alias: The alias is not allowed, because an alias with the name 'inmo' already exists.
New-Alias: The alias is not allowed, because an alias with the name 'pumo' already exists.
New-Alias: The alias is not allowed, because an alias with the name 'upmo' already exists.

But module at the end is loaded

Error details

My machine has PowerShellGet 2.2.5 installed. 
Then I install new module Microsoft.PowerShell.PSResourceGet
Then I install PowerShellGet 3.0.23 for compatibility between PowerShellGet v2 and PSResourceGet modules. 
When I load PowerShellGet 3.0.23 I see the errors.  

When I run:  
Get-Alias -Name 'fimo'

Output: 
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           fimo -> Find-Module                                2.2.5      PowerShellGet

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.8
PSEdition                      Core
GitCommitId                    7.3.8
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

3.0.23-beta23

Visuals

No response

Didjacome commented 5 months ago

I have the same problem

image