Skip to content

Install-PSResource -RequiredResourceFile ignores the prerelease key if set to $true in a psd1 file #1794

Open
@matteocoder

Description

@matteocoder

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

  1. Create a test.psd1 file as follows
@{
	'PrereleaseTest' = @{
        'repository' = 'PSGallery'
        prerelease = $True
        'Scope'      = 'CurrentUser'
    }
}
  1. run Install-PSResource -RequiredResourceFile test.psd1

Consider that the current prerelease version of PrereleaseTest is 0.0.2-prerelease according to PSGallery.

Expected behavior

import-module prereleasetest; get-module prereleasetest
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Manifest   0.0.2      prerelease           prereleasetest

Actual behavior

import-module prereleasetest; get-module prereleasetest
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Manifest   0.0.1                 prereleasetest

Error details

When importing from a json file, though, the prerelease setting is correctly respected.

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.0                 Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-Instal…


Name                           Value
----                           -----
PSVersion                      7.6.0-preview.2
PSEdition                      Core
GitCommitId                    7.6.0-preview.2
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions