carstn / chocolatey-packages

chocolatey package for Go
https://chocolatey.org/packages/golang
The Unlicense
4 stars 3 forks source link

golang package not working with PowerShell PackageManagement module #5

Open gaelcolas opened 7 years ago

gaelcolas commented 7 years ago

Hi,

I'm using PPM instead of the Chocolatey binary, and this package does not work with it. As you can see from the output, this is due to the use of Get-ToolsLocation, not supported by the built in Chocolatey provider coming with WMF5.

PS C:\src\go> install-package golang -force -Verbose
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'.
VERBOSE: Using the provider 'msu' for searching packages.
VERBOSE: Using the provider 'msi' for searching packages.
VERBOSE: Using the provider 'Chocolatey' for searching packages.
VERBOSE: Using the provider 'Programs' for searching packages.
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='golang'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'golang'.
VERBOSE: Performing the operation "Install Package" on target "Package 'golang' version '1.7.1' from 'chocolatey'.".
VERBOSE: NuGet: Attempting to resolve dependency 'chocolatey (= 0.9.10)'.
VERBOSE: NuGet: Installing 'golang 1.7.1'.
VERBOSE: NuGet: Successfully installed 'golang 1.7.1'.
VERBOSE: Exception : DefaultDomain//CommandNotFoundException/The term 'Get-ToolsLocation' 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 System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean
performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input,
PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1
output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PackageManagement.ChocolateyPrototype.ChocolateyRequest.Invoke(String script)
   at Microsoft.PackageManagement.ChocolateyPrototype.ChocolateyRequest.InvokeChocolateyScript(String path, String
workingDirectory)

Name                           Version          Source           Summary
----                           -------          ------           -------
golang                         1.7.1            chocolatey       The Go programming language is an open source proje...

FTR, here's my Setup:

PS C:\src\go> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14926.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14926.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
bgshacklett commented 7 years ago

I can reproduce this as well, trying to install version 1.9.0. Beyond the failure, it's concerning that PackageManagement indicates that it has installed successfully even though the installation actually fails.

PSVersionTable:


Name                           Value                                           
----                           -----                                           
PSVersion                      5.1.14393.1532                                  
PSEdition                      Desktop                                         
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.1532}       
BuildVersion                   10.0.14393.1532                                 
CLRVersion                     4.0.30319.42000                                 
WSManStackVersion              3.0                                             
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1