Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Apr 11, 2022
1 parent 0536fac commit 4bc583d
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 63 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for WingetTools

## v1.3.0

+ Revised private functions used by `Get-WGPackage` that weren't parsing publisher data properly. [Issue #5](https://github.com/jdhitsolutions/WingetTools/issues/5)
+ Updated `README.md`.
+ Help updates.

## v1.2.0

+ Revised regex pattern in `Get-WGUpgrade` that wasn't parsing data properly. This is most likely the fix for [Issue #3](https://github.com/jdhitsolutions/WingetTools/issues/3) and [Issue #4](https://github.com/jdhitsolutions/WingetTools/issues/4).
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ This command is a PowerShell wrapper aroung winget.cmd that will get a package a
The command has a default table view but the output object has other properties you might want to use.

```text
Name : GitHub CLI
ID : GitHub.cli
Version : 2.0.0
Publisher : GitHub, Inc.
Author : GitHub, Inc.
Moniker : gh
Description : GitHubs official command-line tool.
Homepage : https://github.com/cli/cli
License : MIT License
License Url : https://github.com/cli/cli/blob/HEAD/LICENSE
Type : Msi
Locale : en-US
Download Url : https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_windows_amd64.msi
SHA256 : 09761ebfcf1a294b79cf5c820d2a51edca9d5e515cbd1036c45862c462b36189
Name : GitHub CLI
ID : GitHub.cli
Version : 2.7.0
Publisher : GitHub, Inc.
Publisher URL : https://github.com
Publisher Support URL : https://help.github.com/en
Author : GitHub, Inc.
Moniker : gh
Description : gh is GitHub on the command line. It brings pull
requests, issues, and other GitHub concepts to the
terminal next to where you are already working with git
and your code.
Homepage : https://github.com/cli/cli
```

The command typically gets a single package, but you can pipe a winget search command to it.
Expand Down
2 changes: 1 addition & 1 deletion WingetTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@{

RootModule = 'WingetTools.psm1'
ModuleVersion = '1.2.0'
ModuleVersion = '1.3.0'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = '1130bb85-58d1-487d-9763-c38011f9613d'
Author = 'Jeff Hicks'
Expand Down
35 changes: 17 additions & 18 deletions docs/Get-WGPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,23 @@ Get a package by its name.
### Example 2

```powershell
PS C:\> PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object *
Name : PowerShell Preview
ID : Microsoft.PowerShell.Preview
Version : 7.3.0.2
Publisher : Microsoft Corporation
PublisherURL :
PublisherSupport :
Author :
Moniker : pwsh-preview
Description : PowerShell is a cross-platform (Windows, Linux, and macOS)
automation and configuration tool/framework that works well
with your existing tools and is optimized for dealing with
structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and
object models. It includes a command-line shell, an
associated scripting language and a framework for processing
cmdlets.
Homepage : https://microsoft.com/PowerShell
PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object *
Name : PowerShell Preview
ID : Microsoft.PowerShell.Preview
Version : 7.3.0.3
Publisher : Microsoft Corporation
Publisher URL : https://github.com/PowerShell/PowerShell
Publisher Support URL : https://github.com/PowerShell/PowerShell/issues
Author : Microsoft Corporation
Moniker : pwsh-preview
Description : PowerShell is a cross-platform (Windows, Linux, and
macOS) automation and configuration tool/framework that
works well with your existing tools and is optimized
for dealing with structured data (e.g. JSON, CSV, XML,
etc.), REST APIs, and object models.
Homepage : https://microsoft.com/PowerShell
```

The output is a rich object.
Expand Down
32 changes: 15 additions & 17 deletions en-US/WingetTools-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,24 +320,22 @@ Foxit PDF Reader Foxit.FoxitReader 11.2.1.53537 Foxit is a powerful PDF reader
</command:example>
<command:example>
<maml:title>-------------------------- Example 2 --------------------------</maml:title>
<dev:code>PS C:\&gt; PS C:\&gt; Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object *
<dev:code>PS C:\&gt; Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object *

Name : PowerShell Preview
ID : Microsoft.PowerShell.Preview
Version : 7.3.0.2
Publisher : Microsoft Corporation
PublisherURL :
PublisherSupport :
Author :
Moniker : pwsh-preview
Description : PowerShell is a cross-platform (Windows, Linux, and macOS)
automation and configuration tool/framework that works well
with your existing tools and is optimized for dealing with
structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and
object models. It includes a command-line shell, an
associated scripting language and a framework for processing
cmdlets.
Homepage : https://microsoft.com/PowerShell</dev:code>
Name : PowerShell Preview
ID : Microsoft.PowerShell.Preview
Version : 7.3.0.3
Publisher : Microsoft Corporation
Publisher URL : https://github.com/PowerShell/PowerShell
Publisher Support URL : https://github.com/PowerShell/PowerShell/issues
Author : Microsoft Corporation
Moniker : pwsh-preview
Description : PowerShell is a cross-platform (Windows, Linux, and
macOS) automation and configuration tool/framework that
works well with your existing tools and is optimized
for dealing with structured data (e.g. JSON, CSV, XML,
etc.), REST APIs, and object models.
Homepage : https://microsoft.com/PowerShell</dev:code>
<dev:remarks>
<maml:para>The output is a rich object.</maml:para>
</dev:remarks>
Expand Down
28 changes: 15 additions & 13 deletions functions/private.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ function _convert {

#a hashtable to define properties from the winget show output. The value should be the line number
$propertyHash = [ordered]@{
NameID = 0
Version = 1
Publisher = 2
PublisherURL = 3
PublisherSupport = 4
Author = 5
Moniker = 6
Description = 7
Homepage = 8
NameID = 0
Version = 1
Publisher = 2
'Publisher URL' = 3
'Publisher Support URL' = 4
Author = 5
Moniker = 6
Description = 7
Homepage = 8
}

}
Expand All @@ -54,16 +54,18 @@ function _convert {
#add remaining properties

#revised for Issue #2
$propertyHash.GetEnumerator() | Select-Object -skip `1 | foreach-Object {
$propertyHash.GetEnumerator() | Select-Object -Skip 1 | ForEach-Object {
$key = $_.key
$find = $data.Where({$_ -match "$($key):"})
$find = $data.Where({ $_ -match "^($key):" })
if ($find) {
$value = $find.split("$($key):")[1].trim()
$value = ($find -split "^$($key):").trim()[1]
#$find.split("$($key):")[1].trim()
}
else {
$value = $null
}
$hash.Add($key,$Value)
Write-Verbose "[$((Get-Date).TimeofDay) CONVERT] Adding $($key): $value"
$hash.Add($key, $Value)
}
<#
$propertyHash.GetEnumerator() | Select-Object -Skip 1 | ForEach-Object {
Expand Down
Binary file modified images/get-wgpackage-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/get-wgpackage-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4bc583d

Please sign in to comment.