Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use with -Executable gitversion -Package gitversion.portable #2

Closed
Jaykul opened this issue Nov 17, 2021 · 2 comments
Closed

Comments

@Jaykul
Copy link
Owner

Jaykul commented Nov 17, 2021

Get-ChoVersion is using the $Executable parameter, but Set-ChoVersion is not, so we can't install gitversion, because the package name is not the same as the executable name.

Repro:

Set-ChoVersion GitVersion.Portable -Executable GitVersion
Error: Get-Command : The term 'gitversion.portable' is not recognized as the name of a cmdlet, function, script file, or operable program.

After that error, Get-ChoVersion will work, but Set-ChoVersion still fails.

image

@Jaykul
Copy link
Owner Author

Jaykul commented Nov 17, 2021

The fixed version complains (when using a ChoVersion.psd1) about apps that don't have "executable" set.

Specifically, when using this ChoVersion.psd1

@{
    ChocolateyPackages = @(
        @{
            Package = "bicep"
            Version = "0.4.1008"
        }
        @{
            Executable = "gitversion"
            Package = "gitversion.portable"
            Version = "5.8.1"
        }
    )
}

I got this error:

VERBOSE: Setting choco package 'bicep' version 0.4.1008
ERROR: Get-Command : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

NOTE: as a work around, I just set Executable = "bicep" on the first package and that worked.

Have a look at Get-ChoVersion, because that one is handling this properly.

@Jaykul
Copy link
Owner Author

Jaykul commented Nov 18, 2021

Fixed in 1.0.5

@Jaykul Jaykul closed this as completed Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant