Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Upate-Module warns (and should not) when upgrading prerelease module  #207

Open
@ghost

Description

The new prerelease functionality for update-module is generating an inappropriate warning in some cases, and requiring the user to use -Force. This may be related to the Install-Module issue previously filed.

Current behavior

Repro case:

PS:> Install-Module mymodule -RequiredVersion 2.0.0-alpha -AllowPrerelease
PS:> #above item will succeed
PS:> Update-Module mymodule -RequiredVersion 2.0.0 
PS:> #above results in no-op & warning that the user is trying to update the same version. 
PS:> Update-Module mymodule -RequiredVersion 2.0.0-beta -AllowPrerelease
PS:> #above results in no-op & warning that the user is trying to update the same version. 

Expected Behavior

Update-module should succeed in both cases without warning.
In the first case, note that -allowprerelease is not specified, because the user is not installing a prerelease version.

Your Environment

> $PSVersionTable
C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      5.1.15063.726
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.726
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

C:\> Get-Module -ListAvailable PowerShellGet,PackageManagement
    Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.1.7.0    PackageManagement                   {Find-Package, Get-Package,
Script     1.1.6.0    PackageManagement                   {Find-Package, Get-Package,
Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package,
Script     1.6.0      PowerShellGet                       {Install-Module, Find-Module
Script     1.5.0.0    PowerShellGet                       {Install-Module, Find-Module
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module
C:\> Get-PackageProvider
Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.210        Destination, ExcludeVersion, Scope, SkipDependencies,
PowerShellGet            1.6.0.0          PackageManagementProvider, Type, Scope, AllowClobber,
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions