Giter Site home page Giter Site logo

chocolateyget's People

Contributors

ethanbergstrom avatar jberezanski avatar jianyunt avatar sgryphon avatar velocet avatar wtfzambo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chocolateyget's Issues

VLC installation using Provider Name ChocolateyGet

I am facing an issue while installing VLC using the following command:

Install-Module -Name ChocolateyGet -AllowClobber
Install-Package -Name vlc -ProviderName ChocolateyGet -Source chocolatey

Output: "WARNING: Cannot bind argument to parameter 'source' because it is an empty string.

Please guide me so that I can install the VLC media player using chocolatey.

Hash for package 'ChocolateyGet' does not match hash provided from the server.

when I installed chocolateyget , it showed me some "error". I want to know whether it will be a critical issue or not . any advise ?

Hash for package 'ChocolateyGet' does not match hash provided from the server.

bellow is the full output.

[xx.xx.xx.xx]: PS C:> Install-PackageProvider ChocolateyGet -verbose
VERBOSE: Using the provider 'Bootstrap' for searching packages.
VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ChocolateyGet','','','''.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ChocolateyGet'.
VERBOSE: Performing the operation "Install Package" on target "Package 'ChocolateyGet' version '1.0.0.1' from 'PSGallery'.".
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'ChocolateyGet' with version '1.0.0.1' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: InstallPackage' - name='ChocolateyGet', version='1.0.0.1',destination='C:\Users\tlsadmin\AppData\Local\Temp\2015507138'
VERBOSE: DownloadPackage' - name='ChocolateyGet', version='1.0.0.1',destination='C:\Users\tlsadmin\AppData\Local\Temp\2015507138\ChocolateyGet\C
hocolateyGet.nupkg', uri='https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'.
VERBOSE: Completed downloading 'ChocolateyGet'.
VERBOSE: Hash for package 'ChocolateyGet' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='ChocolateyGet', version='1.0.0.1',destination='C:\Users\tlsadmin\AppData\Local\Temp\2015507138'
VERBOSE: Catalog file 'ChocolateyGet.cat' is not found in the contents of the module 'ChocolateyGet' being installed.
VERBOSE: Module 'ChocolateyGet' was installed successfully to path 'C:\Program Files\WindowsPowerShell\Modules\ChocolateyGet\1.0.0.1'.

Updating to newest choco (0.11.1)

ChocolateyGet currently installs a rather old version of Choco (0.10.13), as a workaround for issues present in 0.10.14-15 (and fixed in 0.10.16 beta).

Now that choco 0.11.1 has been released, can ChocolateyGet be updated to install that version (or simply the newest version)?

[Issue] Failed to Install-Package with `-RequiredVersion` option

Hi @jianyunt, thank you for your project. It makes script easier to install packages with choco. I found a tricky behavior, seems like an issue when I Install-Package with the -RequiredVersion option.

❌Failed case

Install-Package -Provider ChocolateyGet -ErrorAction Stop -Verbose -AcceptLicense ninja -RequiredVersion 1.10.2
VERBOSE: Using the provider 'ChocolateyGet' for searching packages.
VERBOSE: Source selected: chocolatey
Install-Package: No match was found for the specified search criteria and package name 'ninja'. Try Get-PackageSource to see all available registered package sources.

✅Passed case

Install-Package -Provider ChocolateyGet -ErrorAction Stop -Verbose -AcceptLicense ninja
VERBOSE: Using the provider 'ChocolateyGet' for searching packages.
VERBOSE: Performing the operation "Install Package" on target "Package 'ninja' version '1.10.2' from 'chocolatey'.".

image

Unable to find any Chocolatey packages

Hi, I have installed ChocolateyGet as per instructions and verified that it is imported. However, when trying to find a package I get these Warnings/Errors.

PS C:\windows\system32> find-package -ProviderName ChocolateyGet -name  nodejs
WARNING: User declined to install Chocolatey.
WARNING: Method invocation failed because [PsRequest_proxy_21] does not contain a method named 'ShouldContinue'.
find-package : No match was found for the specified search criteria and package name 'nodejs'.
At line:1 char:1
+ find-package -ProviderName ChocolateyGet -name  nodejs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

Is there a problem with ChocolateyGet or am I doing something wrong?

Thanks

PowerShell 7 support

Due to changes in how PackageManagement works under PowerShell 7, the provider is no longer discoverable or functional, and can only be ran under PowerShell 5.1 and below.

Find-Package : A parameter cannot be found that matches parameter name 'Provider'.

Following the example from the README.md Find-Package curl -RequiredVersion latest -Provider ChocolateyGet generates the error:

At line:1 char:43
+ Find-Package curl -RequiredVersion latest -Provider ChocolateyGet
+                                           ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Find-Package], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Find-Package```

And dropping the -Provide parameter generates two other errors:

At C:\Program Files\WindowsPowerShell\Modules\ChocolateyGet\4.0.0\private\Find-ChocoPackage.ps1:68 char:6
+     if ($minimumVersion -Or $maximumVersion -Or $options.ContainsKey( ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

New-SoftwareIdentity : The term 'New-SoftwareIdentity' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\ChocolateyGet\4.0.0\private\ConvertTo-SoftwareIdentity.ps1:29 char:4
+             New-SoftwareIdentity @swid
+             ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-SoftwareIdentity:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException```

Proxy Support

When using ChocolateyGet behind a proxy server, in some situations its not working.
While choco.exe can be easily configured to use a proxy https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey#explicit-proxy-settings, the ChocolateyGet Module can't.

Function Install-ChocoBinaries uses Invoke-WebRequest at some point, which doesn't work behind a proxy server per default. While this is not a big deal when using ChocolateyGet in normal PS1 Scripts, as we can set the proxy using [system.net.webrequest]::defaultwebproxy globally, this is not possible when using ChocolateyGet within a PowerShell DSC Configuration as LCM has no option to set a proxy, as far as I know.

That means, there is no way to make it work within a DSC Configuration behind a proxy.

Recommendation: Allow the ChocolateyGet Module to receive AdditionalParameters, so it can be set using the same approach as other package providers, e.g. NuGet https://github.com/PowerShell/PackageManagementProviderResource/blob/master/Examples/Sample_Install_Package_Using_NuGet.ps1 > Note the AdditionalParameters Dictionary, that can be passed.

thanks

Section Keep packages up to date: the "latest" keyword is not needed

The section on Section Keep packages up to date says "PackageManagement/OneGet is it doesn't allow for updating installed packages", but that is not correct. If you install the latest it just updates.

This works similar to Linux e.g. sudo apt-get install , updates to the latest package.

If you leave off the version parameters (-RequiredVersion, -MinimumVersion, -MaximumVersion) then by default it means latest version.

i.e. -RequiredVersion latest is the same as not specifying a version at all.

Get-Package lists chocolatey twice

PS C:\> get-package -ProviderName chocolateyget

Name                           Version          Source                           ProviderName
----                           -------          ------                           ------------
Chocolatey                     v0.10.8          https://www.chocolatey.org       ChocolateyGet
chocolatey                     0.10.8           https://www.chocolatey.org       ChocolateyGet
chocolatey-core.extension      1.3.3            https://www.chocolatey.org       ChocolateyGet
pip                            1.2.0            https://www.chocolatey.org       ChocolateyGet
python                         3.6.4.20180116   https://www.chocolatey.org       ChocolateyGet
python3                        3.6.4.20180116   https://www.chocolatey.org       ChocolateyGet

Should be able to fix by passing the -r flag to choco in Get-InstalledPackages and changing the regex. Example fix based on current version of package: ethanbergstrom/ChocolateyGet@c7a490e

PS C:\> get-package -ProviderName chocolateyget

Name                           Version          Source                           ProviderName
----                           -------          ------                           ------------
chocolatey                     0.10.8           https://www.chocolatey.org       ChocolateyGet
chocolatey-core.extension      1.3.3            https://www.chocolatey.org       ChocolateyGet
pip                            1.2.0            https://www.chocolatey.org       ChocolateyGet
python                         3.6.4.20180116   https://www.chocolatey.org       ChocolateyGet
python3                        3.6.4.20180116   https://www.chocolatey.org       ChocolateyGet

Will hold on PR until after after the multi-source PR is resolved. Fixed in #15

Packages with no checksum appear to fail

Try this:

Install-Package -name 'gifcam' -providername 'chocolateyget' -force

Vs

choco install gifcam

It appears that there's another prompt asking whether to proceed if there's no checksum. In this case gifcam is not installed if attempted to be installed via Install-Package.

Provider installed as PowerShellGet

On a new Windows 10 install, I followed the instructions listed in the README.md. This is the result:

PS C:\Windows\system32> get-packageprovider

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.208        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag...
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, ...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

I tried it again using -Force, and here is the result:

PS C:\Windows\system32> Install-Packageprovider -Verbose -Force ChocolateyGet
VERBOSE: Using the provider 'Bootstrap' for searching packages.
VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ChocolateyGet','','','''.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ChocolateyGet'.
VERBOSE: Performing the operation "Install Package" on target "Package 'ChocolateyGet' version '1.0.0.1' from 'PSGallery'.".
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'ChocolateyGet' with version '1.0.0.1' from the repository 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: InstallPackage' - name='ChocolateyGet', version='1.0.0.1',destination='C:\Users\ben\AppData\Local\Temp\124003892'
VERBOSE: DownloadPackage' - name='ChocolateyGet',
version='1.0.0.1',destination='C:\Users\ben\AppData\Local\Temp\124003892\ChocolateyGet\ChocolateyGet.nupkg',
uri='https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/ChocolateyGet/1.0.0.1'.
VERBOSE: Completed downloading 'ChocolateyGet'.
VERBOSE: Hash for package 'ChocolateyGet' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='ChocolateyGet', version='1.0.0.1',destination='C:\Users\ben\AppData\Local\Temp\124003892'
VERBOSE: Catalog file 'ChocolateyGet.cat' is not found in the contents of the module 'ChocolateyGet' being installed.
VERBOSE: For publisher validation, current module 'ChocolateyGet' with version '1.0.0.1' with publisher name ''. Is this module signed by Microsoft:
'False'.
VERBOSE: For publisher validation, using the previously-installed module 'ChocolateyGet' with version '1.0.0.1' under 'C:\Program
Files\WindowsPowerShell\Modules\ChocolateyGet\1.0.0.1' with publisher name ''. Is this module signed by Microsoft: 'False'.
VERBOSE: Module 'ChocolateyGet' was installed successfully to path 'C:\Program Files\WindowsPowerShell\Modules\ChocolateyGet\1.0.0.1'.

Name                           Version          Source           Summary
----                           -------          ------           -------
ChocolateyGet                  1.0.0.1          PSGallery        An PowerShell OneGet provider that discovers packages from https://www.chocolatey....
VERBOSE: Importing the package provider ChocolateyGet
WARNING: Import-PackageProvider failed. Possibly the provider name is different from the package name 'ChocolateyGet'. Try Get-PackageProvider
-ListAvailable to identify the associated provider name and run Import-PackageProvider".


PS C:\Windows\system32> Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.208        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVers...
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Fi...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

Search problem

Using Find-Package -Name "chrome" -ProviderName ChocolateyGet finds nothing and gives error:

Find-Package : Совпадения для указанных условий поиска и имени пакета "chrome" не найдены. Чтобы просмотреть все доступные зарегистрированные источники пакетов, используйте командлет Get-PackageSource.
строка:1 знак:1
+ Find-Package -Name "chrome" -ProviderName ChocolateyGet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage

While Find-Package -Name "chrome" -ProviderName Chocolatey finds all packages with "chrome" in it's names.

Uninstall without dependencies

Currently, when uninstalling a package with ChocolateyGet, the --remove-dependencies switch is always passed to choco.exe.

In many cases this is not desired behavior. The dependencies removal function of Choco is rather simplistic and does not account for the difference between packages installed automatically as dependency and packages explicitly installed by the user. As such, too many packages may get uninstalled.

Consider these packages:
keepass-plugin-winhello depends on keepass
keepass depends on keepass.install

If a user installs KeePass, then (possibly some time later) installs the WinHello plugin for it, and finally decides that (s)he does not want to use the plugin after all, uninstalling keepass-plugin-winhello will:

  • (when done using choco.exe directly)
    • (with no additional parameters, default behavior) remove the plugin only, keeping KeePass installed
    • (with --remove-dependencies passed explicitly) remove both the plugin and the entire KeePass application
  • (when done using ChocolateyGet) remove the entire KeePass application, with no way of uninstalling the plugin only.

I believe that ChocolateyGet, at the very least, should provide a way to opt out of dependency uninstallation (and perhaps it should even be the default behavior, to align with choco.exe defaults).

Missing Packages from Repo

It looks like some packages are not being found in the repo. For example Vivaldi. If I run choco search vivaldi I see that the package is available and can install it. If I run packagemanager -providername chocolateyget -name vivaldi it tells me no match was found. This is only the case for some packages though. I was able to find and install kdevelop just fine.

PackageManagement version superseded

	RequiredModules = @(
		@{
			ModuleName='PackageManagement'
			ModuleVersion='1.1.7.2'
		},
		@{
			ModuleName='Foil'
			ModuleVersion='0.1.0'
		}
	)

The current version of PackageManagement is 1.4.7 which seems to mess with ChocolateyGet

At least Install-PackageProvider ChocolateyGet -Force doesn't work on for me.

WARNING: The version '1.4.7' of module 'PackageManagement' is currently in use. Retry the operation after closing the applications.

No concept of 'upgrades'

Since PackageManagement and corresponding DSC resource don't natively support the concept of an 'Upgrade-Package' cmdlet, we could expose the concept of an upgrade with the use of a special keyword passed to Get-Package's RequiredVersion parameter that triggers Find-Package's logic to check for the latest version available before checking to see if that version is already installed. The DSC LCM could, in effect, keep the package continually up to date.

# CLI example
Get-Package python -ProviderName chocolateyget -RequiredVersion latest
# DSC Example
PackageManagement PythonChoco {
	Name = 'python'
	RequiredVersion = 'latest'
	ProviderName = 'chocolateyget'
}

Probably could only work if one (and only one) source is available to the provider / configured in chocolatey (Chocolatey.org by default). Example enhancement based on my multi-source branch: ethanbergstrom/ChocolateyGet@399bfa0 with help from @matthewprenger

Will hold on PR until after the multi-source PR is resolved. Fixed in #15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.