GithubHelp home page GithubHelp logo

Publish-Module, Save-Module and Install-Module do not work with pre-release module, which depends on another pre-release module about psresourceget HOT 8 CLOSED

kamennikolov avatar kamennikolov commented on August 17, 2024 5
Publish-Module, Save-Module and Install-Module do not work with pre-release module, which depends on another pre-release module

from psresourceget.

Comments (8)

SteveL-MSFT avatar SteveL-MSFT commented on August 17, 2024 1

I agree that AllowPrerelease should be propagated to other calls once specified by the user or if they specify a specific version string that includes prerelease. Note that a stable module that depends on prerelease dependencies is not a pattern we want to support so that should continue to fail.

from psresourceget.

kumbham avatar kumbham commented on August 17, 2024

@SydneyhSmith @kamennikolov I ran into a similar issue where I'm trying to publish a module that depends on a pre-release version of another module. Publish-Module throws No match was found for the specified search criteria and module name .. error. Are there any workarounds to resolve this problem?

from psresourceget.

kamennikolov avatar kamennikolov commented on August 17, 2024

@kumbham we fixed Publish-Module locally and managed to upload.

from psresourceget.

kumbham avatar kumbham commented on August 17, 2024

@kamennikolov thanks for the response. Do you mind sharing me few pointers on where and how can I fix it?

from psresourceget.

dmilov avatar dmilov commented on August 17, 2024

@kamennikolov thanks for the response. Do you mind sharing me few pointers on where and how can I fix it?

It was back in 2018. We used PowerShellGet 1.6 then. The problem was in the ValidateAndGet-RequiredModuleDetails function of PSModule.psm1

The fix we did locally to be able to publish the prerelease modules was at line 8607 of PSModule.psm1 which calls Find-Module with splatting @FindModuleArguments. The FindModuleArguments hashble is defined 3 lines above at 8604 and the only parameter in it is the Name of the module. That is breaking the validation. -AllowPrerelease has to be specified on the Find-Module to be able to discover the published prerelease module dependencies.

The fix I did then was to replace

Find-Module @FindModuleArguments

with

Find-Module -Name $ModuleName -AllowPrerelease

another option is to add AllowPrerelease key with $true in the FindModuleArguments hashtable

The fix shouldn't have affect non prerelease modules it should work for them as well.

from psresourceget.

TanmayDharmaraj avatar TanmayDharmaraj commented on August 17, 2024

A similar issue arises when I perform Save-Module as well.

from psresourceget.

SteveL-MSFT avatar SteveL-MSFT commented on August 17, 2024

This is fixed via beta10

from psresourceget.

darksidemilk avatar darksidemilk commented on August 17, 2024

Is there any chance of this fix being added as a patch to 2.x ?
I realized that there's been a stop on development and whatnot, but it would be very helpful in our migration path to powershellget 3 and powershell 7 if we could handle these preRelease depdendencies on our current modules.

from psresourceget.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.