PoshCode / ModuleBuilder

A PowerShell Module to help scripters write, version, sign, package, and publish.
MIT License
447 stars 53 forks source link

[discussion] Install-RequiredModule design question #61

Closed gaelcolas closed 4 years ago

gaelcolas commented 5 years ago

Hi, Great work on the Install-RequiredModule script. I'm late to the party, but I have a few questions:

  1. PSGallery Release shows v3.0.0 but this repo shows only v2.0.1. Am I missing something (I don't want to look at the wrong code)

  2. Save-script -Name Install-RequiredModule -path . also downloads PowerShellGet & PackageManagement. Is there a way to turn that off? Is that 'magic' from the #Requires? The problem is that I don't want to download those modules to . or even the same path used by RequiredModules (because DSC and multiple versions problem). I know I could use yet another folder for -Path but wondering if we want to download that to the repo's root anyway...?

  3. This script does not support Pre-release version (on a per module option), how much of a pain would that be to add? How would you suggest I try to implement that feature?

  4. This does not support Proxy/Auth and PSGallery (I saw the TODO), so it's likely to be of limited use within restricted environments with private galleries.

  5. Should -Scope be in a different parameter set than -Destination?

  6. Is the Wait-Debugger line 276 (I think) is meant to stay?

  7. I know you hate this, but are you not re-writing PSDepend? Or is it PowerShellGet? Worth putting in a module? Not that it's a bad thing, just asking :) At least, please consider putting this file in its own repo?

Let me know if you want me to file separate issues for any of those points. I'm happy to send PRs when time permits, but I want to make sure I'm not wasting time going against your intent.

Jaykul commented 5 years ago

So, first of all, yes, I intend to send this to PowerShellGet (soon™)

  1. I have a copy of this in another module where I'm working on a meta module manager (i.e. for selectively loading specific versions of Azure/AzureRm/Az), but I haven't published that module yet -- it was supposed to get written on work time, but then we decided we could wait and write it later. I might be able to dig that up and push it to my repo. The fact is, all of it ought to go in PowerShellGet...
  2. I noticed that problem with Save-Script. It's possible to stop it, but only, I think, by removing the (explicit) dependency (it doesn't seem scripts have any concept of "external dependency").
  3. That's not intentional. I think you can say [3.4-beta,4.0) so it would just be a matter of adding -AllowPreRelease to the find and install command if the VersionRange.MinVersion.IsPrerelease ... Note: the NuGet spec has a long-standing open issue about how to deal with pre-releases
  4. Yeah. Just one of several reasons it's not a PR yet
  5. Probably.
  6. Definitely not. I'm sure I took that out of v3?
  7. Deffinitely not.

No. This is not "rewriting" PSDepend, because PSDepend doesn't bootstrap, and doesn't understand version numbers. And it probably never will, unless you contribute this code to it 😉

I will put this in a fork of PowerShellGet -- the intention here is to add the core functionality to PowerShellGet which should have been part of that module from the very beginning. If I have to put this anywhere other than PowerShellGet, it will mean I am really angry, and am resurrecting PoshCode with the goal of killing off PowerShellGet. 😋

Jaykul commented 5 years ago

OK, now maybe I won't do that ... because of the RFC for 3

Jaykul commented 4 years ago

OK, given that PowerShellGet v3 is a complete toss of PowerShellGet, and there's no telling what will happen and when any particular features will ever get here ...

Install-RequiredModule is now in it's own repo.

It's work in progress, but here: /Jaykul/RequiredModules. It needs a new build-script to create the ps1 which I publish, to the gallery, but working on it as a module makes it a lot easier to test.

I've added support for specifying the gallery, but not for specifying proxies and whatnot, yet. Feel free to file a bug over there 😉