jdhitsolutions / WingetTools

A set of PowerShell tools for working with the winget package manager.
MIT License
146 stars 14 forks source link

fix for • symbol #10

Closed Zephyrusg closed 1 year ago

Zephyrusg commented 1 year ago

I experience that the function get-wgpackege fails with wingit id "putty.putty"

This happens because of the release notes that are in the winget package. The release notes contain the • symbol what powershell replace with 'ÔÇó'

So, I added an extra replace step to change the 'ÔÇó' to another readable symbol *.

Now the regex in the convert private function takes the right lines and the convertfrom-yaml is working again.

jdhitsolutions commented 1 year ago

I still get errors, so I'll keep looking at this.

jdhitsolutions commented 1 year ago

What culture are you running under?

Zephyrusg commented 1 year ago

@jdhitsolutions I running this on a Windows 11 Dev channel on PWS 7.2.6 with culture EN-GB.

But my powershell isn't so sure about that:

Get-Culture | fl *

Parent : LCID : 127 KeyboardLayoutId : 127 Name : IetfLanguageTag : DisplayName : Invariant Language (Invariant Country) NativeName : Invariant Language (Invariant Country) EnglishName : Invariant Language (Invariant Country) TwoLetterISOLanguageName : iv ThreeLetterISOLanguageName : ivl ThreeLetterWindowsLanguageName : IVL

jdhitsolutions commented 1 year ago

I just published v1.6.0 to the PowerShell Gallery. Update the module and try the putty package again. It works now for me.

image

Zephyrusg commented 1 year ago

@jdhitsolutions Thz for pushing it to the PSGallery. It also works for me on Pws 5.1 and 7. 👍

SebCT commented 1 year ago

Hello!

Get-WGPackage did only work for me with these modifications in line 53-54 in the Get-WGpackage.ps1 script, because my profile path has a space:

$winget = "'" + (Get-WGPath | out-string).Trim() + "'" $cmdText = "& " $cmdText += "$winget show --source $source"

SebCT commented 1 year ago

In addition i had to modify the lines 23-24 in private.ps1 for the _convert function because of german OS/WinGet, so that putty also works, sadly the replace with '*' didn't work for the german version:

$i = $list.FindIndex({ $args[0] -match "^Versionshinweise:" }) $j = $list.FindIndex({ $args[0] -match "^Installationsprogramm:" })