{"id":16567503,"url":"https://github.com/jdhitsolutions/wingettools","last_synced_at":"2025-03-16T20:31:01.136Z","repository":{"id":41232549,"uuid":"401446111","full_name":"jdhitsolutions/WingetTools","owner":"jdhitsolutions","description":"A set of PowerShell tools for working with the winget package manager.","archived":false,"fork":false,"pushed_at":"2023-10-27T13:41:20.000Z","size":3411,"stargazers_count":158,"open_issues_count":12,"forks_count":16,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-10T19:57:22.309Z","etag":null,"topics":["powershell","winget-cli"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdhitsolutions.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-30T18:25:48.000Z","updated_at":"2024-12-31T20:44:00.000Z","dependencies_parsed_at":"2024-01-15T16:51:37.265Z","dependency_job_id":null,"html_url":"https://github.com/jdhitsolutions/WingetTools","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FWingetTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FWingetTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FWingetTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FWingetTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdhitsolutions","download_url":"https://codeload.github.com/jdhitsolutions/WingetTools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","winget-cli"],"created_at":"2024-10-11T21:06:45.747Z","updated_at":"2025-03-16T20:31:00.755Z","avatar_url":"https://github.com/jdhitsolutions.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WingetTools\n\n[![PSGallery Version](https://img.shields.io/powershellgallery/v/WingetTools.png?style=for-the-badge\u0026label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/WingetTools/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/WingetTools.png?style=for-the-badge\u0026label=Downloads)](https://www.powershellgallery.com/packages/WingetTools/)\n\n\u003e The Winget team has [released an alpha version](https://github.com/microsoft/winget-cli/releases/tag/v1.4.3531) of a PowerShell module for Winget. In my opinion, it still needs a lot of work, but I'm hopeful. I'm deferring further work on this module in hope that the Winget team can release a viable PowerShell module that would make my module moot.\n\nInstall this module from the PowerShell Gallery. It should work in Windows PowerShell 5.1 and PowerShell 7.x on Windows.\n\n```powershell\nInstall-Module WingetTools\n```\n\nThe WingetTools module is a PowerShell wrapper around the `winget` command-line tool which is [Microsoft's latest package manager and installer](https://github.com/microsoft/winget-cli). `Winget` is a command-line tool, **not** a PowerShell command. The commands in the WingetTools module are designed to make using winget a little more PowerShell friendly.\n\n\u003e **NOTE:** The current version of this module has been tested with winget version `1.3.2091`. If you have an older version, some commands in this module may not work as expected.\n\nInstalling this module will also install the `ThreadJob` and [`psyml`](https://github.com/bitrut94/psyml) modules, which are dependencies.\n\n## Background\n\nThe `winget` utility was never designed with PowerShell in mind. Without going into the years-long discussion about the lack of PowerShell support, `winget` was designed for non-PowerShell audience. The application queries online sources for package information and writes output to the console. Many of the commands in this module resort to brute force parsing of the output and then turning that output into custom objects. As such, some commands may not perform as efficiently as one would like. But they work for now.\n\nThe Winget development team is working on a PowerShell module using Crescendo, but as far as I know that is stil wrapping the native commands in PowerShell. Short of true PowerShell cmdlets, I am hoping for an option where winget output is structured data like JSON. Unfortunately for now, the commands in this module are the best workaround that I can come up with.\n\n## [Install-WinGet](docs/Install-Winget.md)\n\nUntil winget is publically available in the Microsoft Store, you can download and install the latest version from Github. This command **must be run in a Windows PowerShell session** in Windows 10 or Windows 11. The installation is **not** supported in PowerShell 7. The `winget` package requires the DesktopAppInstaller package. If it isn't found locally, it will be downloaded and installed.\n\n![install winget](images/install-winget.png)\n\n## [Get-WGReleaseNote](docs/Get-WGReleaseNote.md)\n\nThis command will query the Github repository for the winget project and display the release note for the latest version.\n\n![Get release note](images/get-wgreleasenote.png)\n\nYou can also display it in markdown format, which is helpful if running in PowerShell 7.\n\n![release note markdown](images/releasenote-markdown.png)\n\nYou also have an option to go online to view the release note.\n\n## [Get-WGPackage](docs/get-WGPackage.md)\n\nThis command is a PowerShell wrapper aroung winget.cmd that will get a package and create an object you can use in PowerShell.\n\n![get winget package](images/get-wgpackage-1.png)\n\nThe command has a default table view but the output object has other properties you might want to use.\n\n```text\nMoniker             : gh\nDescription         : gh is GitHub on the command line. It brings pull\n                      requests, issues, and other GitHub concepts to\n                      the terminal next to where you are already working with git and your code.\nAuthor              : GitHub, Inc.\nPublisher           : GitHub, Inc.\nPublisherUrl        : https://github.com\nPublisherSupportUrl : https://help.github.com/en\nHomepage            : https://github.com/cli/cli\nName                : GitHub CLI\nID                  : GitHub.cli\nVersion             : 2.15.0\nSource              : winget\nComputername        : WIN11DESK\n```\n\nThe command typically gets a single package, but you can pipe a `winget search` command to it.\n\n![get winget package search](images/get-wgpackage-2.png)\n\n## [Get-WGInstalled](docs/Get-WGInstalled.md)\n\nThis command will get a list of all packages installed with `winget`. These will be packages with winget as the source. Here's a sample of the default output.\n\n![installed](images/get-wginstalled.png)\n\nThe custom object has a set of properties that should be found on most `winget` packages.\n\n```powershell\nPS C:\\\u003e Get-WGInstalled | where publisher -match google | select *\n\nName             : Google Drive\nID               : Google.Drive\nInstalledVersion : 61.0.3.0\nOnlineVersion    : 61.0.3.0\nPublisher        : Google LLC\nPublisherUrl     : https://www.google.com\nAuthor           : Google LLC\nMoniker          : google-drive\nDescription      : Mounts Google Drive(s) as a share drive and streams files as needed from the cloud. Alternative to\n                   Google Backup and Sync.\nHomepage         : https://www.google.com/drive/download/\nSource           : winget\nComputername     : PROSPERO\nUpdate           : False\n\nName             : Google Chrome\nID               : Google.Chrome\nInstalledVersion : 104.0.5112.81\nOnlineVersion    : 104.0.5112.81\nPublisher        : Google LLC\nPublisherUrl     : https://www.google.com\nAuthor           : Google LLC\nMoniker          : chrome\nDescription      : A fast, secure, and free web browser built for the modern web. Chrome syncs bookmarks across all\n                   your devices, fills out forms automatically, and so much more.\nHomepage         : https://www.google.com/chrome\nSource           : winget\nComputername     : PROSPERO\nUpdate           : False\n```\n\nThis object type also has a named table view.\n\n![update view](images/update-view.png)\n\n## [Get-WGUpgrade](docs/Get-WGUpgrade.md)\n\nThis command will attempt to get all available updates and create PowerShell-friendly output.\n\n![get-wgupgrade](images/get-wgupgrade.png)\n\nThe default output is formatted as a table. But you can use the output in PowerShell.\n\n```dos\nPS C:\\\u003e Get-WGUpgrade -Name *toys* | select *\n\nSource       : winget\nComputername : PROSPERO\nName         : PowerToys (Preview)\nID           : Microsoft.PowerToys\nVersion      : 0.58.0\nAvailable    : 0.61.1\n```\n\n## [Invoke-WGUpgrade](docs/Invoke-WGUpgrade.md)\n\n`Invoke-WGUpgrade` will run the winget upgrade process using silent installation and accepting all licenses and agreements. It supports `-Whatif`.\n\n```dos\nPS C:\\\u003e Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf\nWhat if: Performing the operation \"Upgrade from 3.2.0+06857 to 3.3.1+06924\" on target \"PrivateInternetAccess.PrivateInternetAccess\".\nWhat if: Performing the operation \"Upgrade from 0.58.0 to 0.61.1\" on target \"Microsoft.PowerToys\".\nWhat if: Performing the operation \"Upgrade from 3.10.3 to 3.10.6\" on target \"Python.Python.3\".\n```\n\nYou might also consider using a command like `Out-Gridview` as an object picker.\n\n```powershell\nGet-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade\n```\n\nBe aware, that winget may still have a problem running the upgrade due to issues isolating upgrade packages.\n\n## [Test-WGVersion](docs/Test-WGVersion.md)\n\nThe test command is an easy way to determine if an update for winget itself is available from Github.\n\n```dos\nPS C:\\\u003e Test-WGVersion\n\nInstalled    Online       Update    Command\n---------    ------       ------    -------\n1.3.2091     1.3.2091     False     C:\\Users\\Jeff\\AppData\\Local\\Microsoft\\WindowsApps\\winget.exe\n```\n\nIf an update is available and you are running the command in the PowerShell console or VSCode, the `Update` value will be displayed in green.\n\nYou can use the `-Quiet` parameter to return a Boolean result.\n\n```dos\nPS C:\\\u003e Test-WGVersion -Quiet\nFalse\n```\n\n## Localization\n\nBeginning with version 1.5.0, I've attempted to handle localization issues. It appears that in some locations, the winget output is localized which throws off the regular expression patterns I originally used. I am now using localized data to parse the winget output and construct the custom objects.  Currently, the only supported cultures are `de-DE` and 'fr-FR`. The default will be `en-US`.\n\nIf you encounter problems running module commands under a different culture, please post an issue. Include the output from these commands.\n\n```powershell\nwinget show --id microsoft.powershell --source winget\nGet-Culture\n```\n\nI've also started to add localized command help. I created German versions using Google Translate, so German speakers are more than welcome to submit a documentation pull request on the markdown files. I would also welcome PRs for other languages. Create a language specific docs folder like `docs-FR`, and add localized versions of the help markdown files. I will generate the module MAML help file after merging the pull request.\n\n## Issues\n\nIf there are problems with commands in this module, try running the winget command directly. Report problems to the module's Github repository at \u003chttps://github.com/jdhitsolutions/WingetTools/issues\u003e.\n\nVisit the winget Github repository for more information about the project at \u003chttps://github.com/microsoft/winget-cli\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdhitsolutions%2Fwingettools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdhitsolutions%2Fwingettools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdhitsolutions%2Fwingettools/lists"}