Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a Winget Show PowerShell equivalent? #3823

Open
jdhitsolutions opened this issue Oct 27, 2023 · 5 comments
Open

Is there a Winget Show PowerShell equivalent? #3823

jdhitsolutions opened this issue Oct 27, 2023 · 5 comments
Labels
Command-Show Issue related to WinGet Show Issue-Feature This is a feature request for the Windows Package Manager client. PowerShell Issue related to WinGet PowerShell Module or cmdlet

Comments

@jdhitsolutions
Copy link

Description of the new feature / enhancement

The cli tool lets me get package details.

 winget show WestWind.MarkdownMonster
Found Markdown Monster [WestWind.MarkdownMonster]
Version: 3.0.8.0
Publisher: West Wind Technologies
Publisher Url: https://markdownmonster.west-wind.com
Publisher Support Url: https://markdownmonster.west-wind.com/docs/_4s0144w3g.htm
Author: Rick Strahl, West Wind Technologies
Moniker: markdown-monster
Description: MarkdownMonster - A powerful, yet easy to use Markdown Editor for Windows
Homepage: https://markdownmonster.west-wind.com
License: Proprietary
License Url: https://markdownmonster.west-wind.com/purchase#License
Copyright: © Rick Strahl, West Wind Technologies, 2015-2023
Copyright Url: https://markdownmonster.west-wind.com/license.txt
Tags:
  documentation
  editor
  markdown
  weblog
Installer:
  Installer Type: inno
  Installer Url: https://github.com/RickStrahl/MarkdownMonsterReleases/raw/master/v3/v3.0/MarkdownMonsterSetup-3.0.8.exe
  Installer SHA256: 9f0fd832b262a6684a134ad100a2a2e6c4fb227e01c4a3c06af92da735970534

But I can't find a comparable equivalent in the PowerShell module. The find command is limited.

find-wingetpackage WestWind.MarkdownMonster | Select *

Version           : 3.0.8.0
Name              : Markdown Monster
Id                : WestWind.MarkdownMonster
IsUpdateAvailable : False
Source            : winget
AvailableVersions : {3.0.8.0, 3.0.5.0, 3.0.4.0, 3.0.3.0…}

Proposed technical implementation details

Show is a valid verb so you should be able to add Show-Wingetpackage and write a structured object to the pipeline. The command should write a structured object to the pipeline with these properties.

Version: 3.0.8.0
Publisher: West Wind Technologies
Publisher Url: https://markdownmonster.west-wind.com
Publisher Support Url: https://markdownmonster.west-wind.com/docs/_4s0144w3g.htm
Author: Rick Strahl, West Wind Technologies
Moniker: markdown-monster
Description: MarkdownMonster - A powerful, yet easy to use Markdown Editor for Windows
Homepage: https://markdownmonster.west-wind.com
License: Proprietary
License Url: https://markdownmonster.west-wind.com/purchase#License
Copyright: © Rick Strahl, West Wind Technologies, 2015-2023
Copyright Url: https://markdownmonster.west-wind.com/license.txt

Tags should be an array property.

Tags:
  documentation
  editor
  markdown
  weblog

I'd make the Installer property a nested object.

Installer:
  Installer Type: inno
  Installer Url: https://github.com/RickStrahl/MarkdownMonsterReleases/raw/master/v3/v3.0/MarkdownMonsterSetup-3.0.8.exe
  Installer SHA256: 9f0fd832b262a6684a134ad100a2a2e6c4fb227e01c4a3c06af92da735970534
@jdhitsolutions jdhitsolutions added the Issue-Feature This is a feature request for the Windows Package Manager client. label Oct 27, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Oct 27, 2023
@denelon denelon added PowerShell Issue related to WinGet PowerShell Module or cmdlet and removed Needs-Triage Issue need to be triaged labels Oct 27, 2023
@stephengillie
Copy link

For an unofficial implementation, consider starting with Search-WinGetManifest and replacing a couple of words to arrive at Show-WinGetPackage:

Function Show-WinGetPackage ($term) {
	$out = WinGet show $term --disable-interactivity  #| where {$_ -notmatch "Γûê"}
	return $out 
}

From here, the output could be parsed and modified using Select before return.

@jdhitsolutions
Copy link
Author

jdhitsolutions commented Oct 27, 2023

I am doing something similar with Get-WGPackage from my WingetTools module.

PS C:\> get-wgpackage -id WestWind.MarkdownMonster | select *


Moniker             : markdown-monster
Description         : MarkdownMonster A powerful, yet easy to use Markdown Editor for Windows
Author              : Rick Strahl, West Wind Technologies
Publisher           : West Wind Technologies
PublisherUrl        : https://markdownmonster.west-wind.com
PublisherSupportUrl : https://markdownmonster.west-wind.com/docs/_4s0144w3g.htm
Homepage            : https://markdownmonster.west-wind.com
Name                : Markdown Monster
ID                  : WestWind.MarkdownMonster
Version             : 3.0.8.0
Source              : winget
Computername        : PROSPERO

I am hoping for a more native solution that doesn't require parsing YAML.

@jdhitsolutions
Copy link
Author

Instead of a new command, you could add the manifest details as a metadata property on the output object. Find-Module does that with an AdditionalMetadata property.

@denelon denelon added the Command-Show Issue related to WinGet Show label Oct 25, 2024
@denelon denelon added this to WinGet Oct 25, 2024
@denelon denelon moved this to To Do in WinGet Oct 25, 2024
@denelon
Copy link
Contributor

denelon commented Nov 15, 2024

I'm not familiar with the best idiom here.

Get-WinGetPackage is showing the "installed" packages.
Find-WinGetPackage is showing what's available in configured sources.

I was wondering if something like adding that to the output of Find-WinGetPackage <PackageId> -Verbose is the right way to do this vs. FindWinGetPackage <PackageId> | Select *.

There is also the interesting caveat with respect to showing available versions which would be likely cause more round trips to the remote source to fetch the versions rather than showing the metadata from the latest version or a particular version that has been specified.

I'll chat with some of the folks on the PowerShell team about this one.

@denelon
Copy link
Contributor

denelon commented Nov 15, 2024

If we were to do something like Get-WinGetManifest <Package ID> and display the logically equivalent metadata from winget show <package>. In order to reduce all the extra network round trips, this cmdlet would require the argument to uniquely identify a single package (and version) in order to render some output.

The actual manifest would contain all the localized content as well as the installers for all scopes, so that would be extra metadata in the object that could be expected for a single version of a package.

In theory, then a user could do something like Get-WinGetManifest <PackageId> | Install-WinGetPackage and that would somewhat mirror the behavior of:
winget show <package> followed by winget install <package>.

@Gijsreyn Gijsreyn marked this as a duplicate of #5082 Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Show Issue related to WinGet Show Issue-Feature This is a feature request for the Windows Package Manager client. PowerShell Issue related to WinGet PowerShell Module or cmdlet
Projects
Status: To Do
Development

No branches or pull requests

3 participants