dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

Install fails while retrieving member "TryParse" as it violates the constraint of type 'T1' #954

Closed Infro closed 1 year ago

Infro commented 1 year ago

System Details

Issue Description

I am experiencing a problem with installing, possibly has something to do with overriding profile.

PS D:\dev> $Env:TEMP
C:\Users\fvadult\AppData\Local\Temp
PS D:\dev> $Env:USERPROFILE
D:\gm\data\Users\Infro
PS D:\dev> PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
VERBOSE: Using the provider 'PowerShellGet' for searching packages.tcher, pid: 10188]: successfully created
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'. 7976]: successfully created
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.stem privacy settings.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'' for ''.ror
VERBOSE: Total package yield:'1' for the specified package 'posh-git'.
VERBOSE: Performing the operation "Install-Module" on target "Version '1.1.0' of module 'posh-git'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.supported, GL is disabled, ANGLE is
VERBOSE: The specified module will be installed in 'D:\gm\data\Users\Infro\Documents\PowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'posh-git' with version '' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'' for ''.
VERBOSE: InstallPackage' - name='posh-git', version='1.1.0',destination='C:\Users\fvadult\AppData\Local\Temp\168782347'
VERBOSE: DownloadPackage' - name='posh-git', version='1.1.0',destination='C:\Users\fvadult\AppData\Local\Temp\168782347\posh-git.1.1.0\posh-git.1.1.0.nupkg', uri='https://www.powershellgallery.com/api/v2/package/posh-git/1.1.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/posh-git/1.1.0'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/posh-git/1.1.0'.
VERBOSE: Completed downloading 'posh-git'.
VERBOSE: InstallPackageLocal' - name='posh-git', version='1.1.0',destination='C:\Users\fvadult\AppData\Local\Temp\168782347'
Install-Package: The following exception occurred while retrieving member "TryParse": "GenericArguments[0], 'System.ReadOnlySpan`1[System.Char]', on 'System.Func`3[T1,T2,TResult]' violates the constraint of type 'T1'."
dahlbyk commented 1 year ago

That looks like a PowerShellGet error. Try installing a different package?

Infro commented 1 year ago

Don't know why it was failing but got it working on PS Version, 5.1.19041.2673 and a bunch of other configuration changes. shrug

dahlbyk commented 1 year ago

If you can still reproduce the install error on newer versions of PowerShell you might open an issue at https://github.com/PowerShell/PowerShellGet. Do you know what version of PowerShellGet you have?