Skip to content

Install-PSResource should not require Prerelease for modules that don't have a stable version #1247

@ThomasNieto

Description

@ThomasNieto

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

If a module does not have any stable versions then Install-PSResource should not require the use of Prerelease because all versions are prerelease.

It creates user confusion when it says the resource is not found on the repository when it does indeed exist.

Install-PSResource Microsoft.PowerShell.TextUtility
Install-PSResource: Package for installation could not be found due to: Package does not exist on the server.

Expected behavior

# Installs successfully

Actual behavior

Install-PSResource: Package for installation could not be found due to: Package does not exist on the server.

Error details

Exception             :
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.InvalidOrEmptyResponse
    Message : Package for installation could not be found due to: Package does not exist on the server.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper
CategoryInfo          : InvalidOperation: (Microsoft.PowerShel…dlets.InstallHelper:InstallHelper) [Install-PSResource], InvalidOrEmptyResponse
FullyQualifiedErrorId : InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
InvocationInfo        :
    MyCommand        : Install-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 47
    Line             : Install-PSResource Microsoft.PowerShell.TextUtility
    Statement        : Install-PSResource Microsoft.PowerShell.TextUtility
    PositionMessage  : At line:1 char:1
                       + Install-PSResource Microsoft.PowerShell.TextUtility
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Install-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

7.4-preview4
beta22

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions