JustinGrote / ModuleFast

A "fast and loose" way to install modules from Powershell Gallery quickly. Meant for CICD, not production
Other
77 stars 5 forks source link

Get plan for prerelease version for individual modules #7

Closed johlju closed 8 months ago

johlju commented 1 year ago

I would like to see that it would be possible to specify that Get-ModuleFastPlan should fetch the latest prerelease version for an individual module.

@('Pester', @{ModuleName='DnsServerDsc';Prerelease = $true}) | Get-ModuleFastPlan -Update

which would result in (latest version as of today):

Passing PreRelease to the command Get-ModuleFastPlan does not seem to have any effect of fetching latest preview version either.

JustinGrote commented 8 months ago

Since modulespecification has no native support for this, I've decided to use the syntax of adding a ! to either the beginning or end of the modulename. While ! is a valid filename character, it is not a valid nuget package character, and thus a module with this name would not be published to an nuget gallery. I'm OK with the edge case that this maybe would work with a filesystem package, and I'm going to put that into unsupported territory.

I will probably add that Prelease property you suggested for the hashtable cast syntax as well.

Usages

Install-ModuleFast 'Az!'  -WhatIf
@('Pester', @{ModuleName='DnsServerDsc';Prerelease = $true}) | Install-ModuleFast -WhatIf
@('Pester', @{ModuleName='!DnsServerDsc'}) | Install-ModuleFast -WhatIf
Install-ModuleFast 'PrereleaseTest!<0.0.2' -WhatIf

EDIT: Prerelease = true will come later with manifest support.