Skip to content

Break out Install-GitHubRelease #2

@Jaykul

Description

@Jaykul

Since there's no other cross-platform solution, can we make this a module like RequiredModules?

  1. Break it out and stick it back together with ModuleBuilder
  2. Ship it as a module as well (so I can install it with Install-ModuleFast)
  3. Make Install-GitHubRelease handle more inputs:
  4. Provide a tinyurl so we can run it directly like Install-ModuleFast?
    Even better, can we have some sort of combined tool that would call both?
  5. Provide a way to pass a list so I can skip some of this:
    # Single-binary dependencies we can install from github
    $Tools = @{
        # A mapping of the tool to the github user and project
        yq = "mikefarah","yq"
        kubeconform = "yannh","kubeconform"
        conftest = "open-policy-agent","conftest"
        flux = "fluxcd","flux2"
    }

    # Search for them
    if ((Get-Command $Tools.Keys -ErrorAction SilentlyContinue -ErrorVariable missing).Count -lt $Tools.Count) {
        # Make sure Install-GitHubRelease is here
        if (!($installer = Get-Command Install-GitHubRelease -ErrorAction Ignore)) {
            Write-Information "Installing Install-GithubRelease"
            # The Script path isn't in the PATH on the build servers, so ...
            $Script = Install-Script Install-GithubRelease -Force -PassThru
            $installer = Get-Command (Join-Path $Script.InstalledLocation $Script.Name)
        }
        # Index into tools with each missing tool and splat the user & project to Install-GitHubRelease
        foreach ($tool in $Tools[$missing.TargetObject]) {
            Write-Information "Installing $tool"
            &$installer @tool
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions