Add prerelease module as a requiredmodule in a psd1

Welcome Forums General PowerShell Q&A Add prerelease module as a requiredmodule in a psd1

Viewing 1 reply thread
  • Author
    Posts
    • #243500
      Participant
      Topics: 13
      Replies: 26
      Points: 110
      Rank: Participant

      Is there a way to have a prerelease module set as a required module in a psd1? I want my module to auto download the prerelease module when I install it from the gallery. In my case, Microsoft.PowerShell.SecretManagement.

      My psd1 contains this under required modules:

      RequiredModules = @(
          @{ModuleName = 'Microsoft.Powershell.SecretManagement'; ModuleVersion = '0.2.1'; Guid = '766a9266-f2ba-4146-bec2-bb30bf5a4f0a'}
      )

      Even with the Guid it still can’t be found using that syntax. I can’t specify 0.2.1-alpha1 as the version either.

      Is there a possible workaround for this?

    • #243527
      Senior Moderator
      Topics: 9
      Replies: 1310
      Points: 4,789
      Helping Hand
      Rank: Community Hero

      I Didn’t think too much, but feels like PSDepend would help you here.

      https://github.com/RamblingCookieMonster/PSDepend

Viewing 1 reply thread
  • You must be logged in to reply to this topic.