├── .github └── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ ├── feature-request.yml │ └── other-request.yml ├── Changelog.md ├── LICENSE.txt ├── README.md ├── WingetTools.psd1 ├── WingetTools.psm1 ├── de-DE ├── WingetTools-help.xml ├── about_wingettools.txt └── localized.psd1 ├── docs-DE ├── Get-WGInstalled.md ├── Get-WGPackage.md ├── Get-WGPath.md ├── Get-WGReleaseNote.md ├── Get-WGUpgrade.md ├── Install-WinGet.md ├── Invoke-WGUpgrade.md └── Test-WGVersion.md ├── docs ├── Get-WGInstalled.md ├── Get-WGPackage.md ├── Get-WGPath.md ├── Get-WGReleaseNote.md ├── Get-WGUpgrade.md ├── Install-WinGet.md ├── Invoke-WGUpgrade.md ├── Test-WGVersion.md └── about_WingetTools.md ├── en-US ├── WingetTools-help.xml ├── about_WingetTools.help.txt └── localized.psd1 ├── formats ├── wginstalled.format.ps1xml ├── wgpackage.format.ps1xml ├── wgversion.format.ps1xml └── wingetupgrade.format.ps1xml ├── fr-FR └── localized.psd1 ├── functions ├── Get-WGInstalled.ps1 ├── Get-WGPackage.ps1 ├── Get-WGReleaseNote.ps1 ├── Get-WingetPath.ps1 ├── Get-WingetUpgrade.ps1 ├── Install-Winget.ps1 ├── Invoke-WingetUpgrade.ps1 ├── Test-WGVersion.ps1 └── private.ps1 ├── images ├── get-wginstalled.png ├── get-wgpackage-1.png ├── get-wgpackage-2.png ├── get-wgreleasenote.png ├── get-wgupgrade-bug.png ├── get-wgupgrade.png ├── install-upgrade.png ├── install-winget.png ├── releasenote-markdown.png └── update-view.png ├── tests └── WingetTools.tests.ps1 └── types └── wginstalled.types.ps1xml /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: 🪲 Bug Report 2 | description: Report a bug or problem. 3 | title: "[Bug]: " 4 | labels: ["bug","triage"] 5 | assignees: 6 | - jdhitsolutions 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: "## Thank you for bringing this to our attention." 11 | - type: textarea 12 | id: description 13 | attributes: 14 | label: Describe the problem 15 | description: Please describe the bug or problem including the exact syntax you are using and any error or warning messages. 16 | validations: 17 | required: true 18 | - type: textarea 19 | id: expected-behavior 20 | attributes: 21 | label: Expectation 22 | description: What did you expect to happen? 23 | - type: textarea 24 | id: additional-info 25 | attributes: 26 | label: Additional Information 27 | description: Do you have any additional information or context that you think will be helpful in resolving this issue? Include the version of winget you are running. 28 | - type: dropdown 29 | id: psversion 30 | attributes: 31 | label: PowerShell version 32 | description: What version of PowerShell are you running? 33 | options: 34 | - '4.0' 35 | - '5.1' 36 | - 6.x 37 | - '7.0' 38 | - '7.1' 39 | - '7.2' 40 | - Other 41 | validations: 42 | required: true 43 | - type: dropdown 44 | id: platform 45 | attributes: 46 | label: Platform 47 | description: What operating system are you running? 48 | options: 49 | - Windows 10 Home 50 | - Windows 11 Home 51 | - Windows 10 Pro or Enterprise 52 | - Windows 11 Pro or Enterprise 53 | - MacOS 54 | - Linux 55 | - Other 56 | - type: checkboxes 57 | id: checks 58 | attributes: 59 | label: Additional Checks 60 | description: Have you verified the following? 61 | options: 62 | - label: You are using the latest version of this module. 63 | required: true 64 | - label: You have read this repository's README file. 65 | - label: You have read full help and examples for the command you are having problems with. 66 | - label: You are running PowerShell in an elevated session. 67 | - label: You are running in a traditional PowerShell console or Windows Terminal 68 | 69 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: README 4 | url: https://github.com/jdhitsolutions/WingetTools/blob/main/README.md 5 | about: Open this module's README.md file. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: 💡Feature Request 2 | description: Request a new feature or enhancement 3 | title: "[Request]: " 4 | labels: ["enhancement","triage"] 5 | assignees: 6 | - jdhitsolutions 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: "## Thank you for bringing this to our attention." 11 | - type: textarea 12 | id: description 13 | attributes: 14 | label: Describe the request 15 | description: Please describe your feature request or enhancement in detail. What deficiency does it address in the module? What use cases support your request? 16 | validations: 17 | required: true 18 | - type: dropdown 19 | id: psversion 20 | attributes: 21 | label: PowerShell version 22 | description: What version of PowerShell are you running? 23 | options: 24 | - '4.0' 25 | - '5.1' 26 | - 6.x 27 | - '7.0' 28 | - '7.1' 29 | - '7.2' 30 | - Other 31 | validations: 32 | required: false 33 | - type: dropdown 34 | id: platform 35 | attributes: 36 | label: Platform 37 | description: What operating system are you running? 38 | options: 39 | - Windows 10 Home 40 | - Windows 11 Home 41 | - Windows 10 Pro or Enterprise 42 | - Windows 11 Pro or Enterprise 43 | - MacOS 44 | - Linux 45 | - Other 46 | 47 | 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other-request.yml: -------------------------------------------------------------------------------- 1 | name: 🤔Other Request or Question 2 | description: Open a request for all other issues 3 | title: "[Question]: " 4 | labels: ["question","triage"] 5 | assignees: 6 | - jdhitsolutions 7 | body: 8 | - type: textarea 9 | id: description 10 | attributes: 11 | label: Describe the question or issue 12 | description: What is on your mind? 13 | validations: 14 | required: true 15 | - type: dropdown 16 | id: psversion 17 | attributes: 18 | label: PowerShell version 19 | description: What version of PowerShell are you running? 20 | options: 21 | - '4.0' 22 | - '5.1' 23 | - 6.x 24 | - '7.0' 25 | - '7.1' 26 | - '7.2' 27 | - Other 28 | validations: 29 | required: false 30 | - type: dropdown 31 | id: platform 32 | attributes: 33 | label: Platform 34 | description: What operating system are you running? 35 | options: 36 | - Windows 10 Home 37 | - Windows 11 Home 38 | - Windows 10 Pro or Enterprise 39 | - Windows 11 Pro or Enterprise 40 | - MacOS 41 | - Linux 42 | - Other 43 | 44 | 45 | -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog for WingetTools 2 | 3 | ## v1.7.0 4 | 5 | - Updated `Get-WingetPath` to use source from `Get-Command` under the user context. 6 | - Merged [PR #18](https://github.com/jdhitsolutions/WingetTools/pull/18) 7 | 8 | ## v1.6.0 9 | 10 | - Added missing online help links. 11 | - Added localized data for `fr-FR`. This needs to be validated by someone running this culture as I'm not sure exactly what Winget will return. 12 | - Modified code to filter out extended ASCII characters when parsing YAML content. 13 | - Merged [PR #10](https://github.com/jdhitsolutions/WingetTools/pull/10) Thank you @Zephyrusg. 14 | - Modified conversion code to strip out Release Notes since that section often causes yaml conversion problems and it isn't being used. 15 | - Updated help. 16 | - Updated `README.md`. 17 | 18 | ## v1.5.0 19 | 20 | - Revised `Get-WGInstalled` to better handle non-English culture. [Issue #8](https://github.com/jdhitsolutions/WingetTools/issues/8) 21 | - Renamed `Get-WingetPath` to `Get-WGPath`. 22 | - Added a requirement for the `psyml` PowerShell module. 23 | - Added cultural localization for DE-DE to parse `winget` output. 24 | - Added help documention for de-DE. 25 | - Defined custom objects as PowerShell classes. 26 | - Renamed `wginstalled` property set to `versioninfo`. 27 | - Added default list formats for `wginstall` and `wgpackage` types. 28 | - Updated help. 29 | - Updated `README.md`. 30 | 31 | ## v1.4.1 32 | 33 | - Update module to support running in SYSTEM context. [Pull request #7](https://github.com/jdhitsolutions/WingetTools/pull/7) 34 | 35 | ## v1.4.0 36 | 37 | - Added new parameters to `Invoke-WGUpgrade` [Issue #6](https://github.com/jdhitsolutions/WingetTools/issues/6) 38 | - Major rewrite to `Get-WGInstalled`. Removed `Write-Progress` for better performance. Moved to using ThreadJobs to get online information in the background. Created a new object type, `WGInstalled`. **This could be a breaking change.** 39 | - Major rewrite to `Get-WGUpgrade`. **This could be a breaking change.** 40 | - Added `ThreadJob` as a required dependency. 41 | - Added a `Computername` property to output objects that reflect local installations. 42 | - Added types file `wginstalled.types.ps1xml`. 43 | - Added format file `wginstalled.format.ps1xml`. 44 | - Revised format file `wingetupgrade.format.ps1xml` 45 | - Updated `README.md`. 46 | - Help updates. 47 | 48 | ## v1.3.0 49 | 50 | - Revised private functions used by `Get-WGPackage` that weren't parsing publisher data properly. [Issue #5](https://github.com/jdhitsolutions/WingetTools/issues/5) 51 | - Updated `README.md`. 52 | - Help updates. 53 | 54 | ## v1.2.0 55 | 56 | - 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). 57 | - Updated `README.md`. 58 | - Help updates. 59 | 60 | ## v1.1.1 61 | 62 | - Fixed bug in `Get-WGUpgrade` that wasn't parsing data properly. [Issue #3](https://github.com/jdhitsolutions/WingetTools/issues/3) 63 | - Updated `README.md`. 64 | - Help updates. 65 | 66 | ## v1.1.0 67 | 68 | - Fixed bug in `Get-WGPackage` to better handle non-English systems. [Issue #1](https://github.com/jdhitsolutions/WingetTools/issues/1) 69 | - Improved parsing and regular expression matching to better process results. [Issue #2](https://github.com/jdhitsolutions/WingetTools/issues/2) 70 | - help updates 71 | - Minor updates to `README.md`. 72 | 73 | ## v1.0.0 74 | 75 | - Fixed bug with `Get-WGUpgrade` that had bad formatting when running the command either first thing in the day, or when some sort of caching was getting cleared. 76 | - Added command `Test-WGVersion` and format file `wgversion.format.ps1xml`. 77 | - Updated `Get-WGReleaseNote` to include the online link. 78 | - Modified the object typename for `Get-WGReleaseNote` to align it with other object names in this module. __*This is a breaking change.*__ 79 | - Updated help documentation. 80 | - Updated `README.md`. 81 | 82 | ## v0.7.0 83 | 84 | - Added `Get-WGUpgrade` and `Invoke-WGUpgrade`. 85 | - Added format file `wingetupgrade.format.ps1xml`. 86 | - Fixed package name typo in `Install-Winget`. 87 | - Updated manifest to export all commands. PowerShell 7.2 now supports the Appx module which had been a blocker. **This is a breaking change.** 88 | - Fixed bug in `Get-WGPackage` with the `Source` parameter. 89 | - Updated help documentation. 90 | - License update. 91 | - Updated `README.md`. 92 | 93 | ## v0.6.0 94 | 95 | - Update `Install-Winget` to allow installing latest stable or preview build. 96 | - Update `Get-WGReleaseNote` to allow getting latest stable or preview release note. 97 | - Updated help documentation. 98 | 99 | ## v0.5.1 100 | 101 | - Revised `Install-Winget` to better test for the VCLibs requirement. 102 | - Updated help documentation. 103 | 104 | ## v0.5.0 105 | 106 | - Revised `Install-Winget` to download the VCLib requirement and then install it instead of relying on `Add-AppxPackage` and a URL path which doesn't always work. 107 | 108 | ## v0.4.0 109 | 110 | - Modified manifest to only export `Install-Winget` in Windows PowerShell sessions. 111 | - Added online help links. 112 | - Updated `README.md`. 113 | - First public release. 114 | 115 | ## v0.3.0 116 | 117 | - Added `Get-WGInstalled` to list winget installed packages. 118 | - Added `Source` parameter to `Get-WGInstalled` and `Get-WGPackage`. 119 | - Updated `README.md`. 120 | - Update about help topic. 121 | 122 | ## v0.2.0 123 | 124 | - Added parameter to `Get-WGPackage` to accept winget output. 125 | - Created external help documentation. 126 | 127 | ## v0.1.0 128 | 129 | - initial module. 130 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021-2023 JDH Information Technology Solutions, Inc. 2 | 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WingetTools 2 | 3 | [![PSGallery Version](https://img.shields.io/powershellgallery/v/WingetTools.png?style=for-the-badge&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/WingetTools/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/WingetTools.png?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/WingetTools/) 4 | 5 | > 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. 6 | 7 | Install this module from the PowerShell Gallery. It should work in Windows PowerShell 5.1 and PowerShell 7.x on Windows. 8 | 9 | ```powershell 10 | Install-Module WingetTools 11 | ``` 12 | 13 | The 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. 14 | 15 | > **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. 16 | 17 | Installing this module will also install the `ThreadJob` and [`psyml`](https://github.com/bitrut94/psyml) modules, which are dependencies. 18 | 19 | ## Background 20 | 21 | The `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. 22 | 23 | The 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. 24 | 25 | ## [Install-WinGet](docs/Install-Winget.md) 26 | 27 | Until 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. 28 | 29 | ![install winget](images/install-winget.png) 30 | 31 | ## [Get-WGReleaseNote](docs/Get-WGReleaseNote.md) 32 | 33 | This command will query the Github repository for the winget project and display the release note for the latest version. 34 | 35 | ![Get release note](images/get-wgreleasenote.png) 36 | 37 | You can also display it in markdown format, which is helpful if running in PowerShell 7. 38 | 39 | ![release note markdown](images/releasenote-markdown.png) 40 | 41 | You also have an option to go online to view the release note. 42 | 43 | ## [Get-WGPackage](docs/get-WGPackage.md) 44 | 45 | This command is a PowerShell wrapper aroung winget.cmd that will get a package and create an object you can use in PowerShell. 46 | 47 | ![get winget package](images/get-wgpackage-1.png) 48 | 49 | The command has a default table view but the output object has other properties you might want to use. 50 | 51 | ```text 52 | Moniker : gh 53 | Description : gh is GitHub on the command line. It brings pull 54 | requests, issues, and other GitHub concepts to 55 | the terminal next to where you are already working with git and your code. 56 | Author : GitHub, Inc. 57 | Publisher : GitHub, Inc. 58 | PublisherUrl : https://github.com 59 | PublisherSupportUrl : https://help.github.com/en 60 | Homepage : https://github.com/cli/cli 61 | Name : GitHub CLI 62 | ID : GitHub.cli 63 | Version : 2.15.0 64 | Source : winget 65 | Computername : WIN11DESK 66 | ``` 67 | 68 | The command typically gets a single package, but you can pipe a `winget search` command to it. 69 | 70 | ![get winget package search](images/get-wgpackage-2.png) 71 | 72 | ## [Get-WGInstalled](docs/Get-WGInstalled.md) 73 | 74 | This 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. 75 | 76 | ![installed](images/get-wginstalled.png) 77 | 78 | The custom object has a set of properties that should be found on most `winget` packages. 79 | 80 | ```powershell 81 | PS C:\> Get-WGInstalled | where publisher -match google | select * 82 | 83 | Name : Google Drive 84 | ID : Google.Drive 85 | InstalledVersion : 61.0.3.0 86 | OnlineVersion : 61.0.3.0 87 | Publisher : Google LLC 88 | PublisherUrl : https://www.google.com 89 | Author : Google LLC 90 | Moniker : google-drive 91 | Description : Mounts Google Drive(s) as a share drive and streams files as needed from the cloud. Alternative to 92 | Google Backup and Sync. 93 | Homepage : https://www.google.com/drive/download/ 94 | Source : winget 95 | Computername : PROSPERO 96 | Update : False 97 | 98 | Name : Google Chrome 99 | ID : Google.Chrome 100 | InstalledVersion : 104.0.5112.81 101 | OnlineVersion : 104.0.5112.81 102 | Publisher : Google LLC 103 | PublisherUrl : https://www.google.com 104 | Author : Google LLC 105 | Moniker : chrome 106 | Description : A fast, secure, and free web browser built for the modern web. Chrome syncs bookmarks across all 107 | your devices, fills out forms automatically, and so much more. 108 | Homepage : https://www.google.com/chrome 109 | Source : winget 110 | Computername : PROSPERO 111 | Update : False 112 | ``` 113 | 114 | This object type also has a named table view. 115 | 116 | ![update view](images/update-view.png) 117 | 118 | ## [Get-WGUpgrade](docs/Get-WGUpgrade.md) 119 | 120 | This command will attempt to get all available updates and create PowerShell-friendly output. 121 | 122 | ![get-wgupgrade](images/get-wgupgrade.png) 123 | 124 | The default output is formatted as a table. But you can use the output in PowerShell. 125 | 126 | ```dos 127 | PS C:\> Get-WGUpgrade -Name *toys* | select * 128 | 129 | Source : winget 130 | Computername : PROSPERO 131 | Name : PowerToys (Preview) 132 | ID : Microsoft.PowerToys 133 | Version : 0.58.0 134 | Available : 0.61.1 135 | ``` 136 | 137 | ## [Invoke-WGUpgrade](docs/Invoke-WGUpgrade.md) 138 | 139 | `Invoke-WGUpgrade` will run the winget upgrade process using silent installation and accepting all licenses and agreements. It supports `-Whatif`. 140 | 141 | ```dos 142 | PS C:\> Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf 143 | What if: Performing the operation "Upgrade from 3.2.0+06857 to 3.3.1+06924" on target "PrivateInternetAccess.PrivateInternetAccess". 144 | What if: Performing the operation "Upgrade from 0.58.0 to 0.61.1" on target "Microsoft.PowerToys". 145 | What if: Performing the operation "Upgrade from 3.10.3 to 3.10.6" on target "Python.Python.3". 146 | ``` 147 | 148 | You might also consider using a command like `Out-Gridview` as an object picker. 149 | 150 | ```powershell 151 | Get-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade 152 | ``` 153 | 154 | Be aware, that winget may still have a problem running the upgrade due to issues isolating upgrade packages. 155 | 156 | ## [Test-WGVersion](docs/Test-WGVersion.md) 157 | 158 | The test command is an easy way to determine if an update for winget itself is available from Github. 159 | 160 | ```dos 161 | PS C:\> Test-WGVersion 162 | 163 | Installed Online Update Command 164 | --------- ------ ------ ------- 165 | 1.3.2091 1.3.2091 False C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\winget.exe 166 | ``` 167 | 168 | If an update is available and you are running the command in the PowerShell console or VSCode, the `Update` value will be displayed in green. 169 | 170 | You can use the `-Quiet` parameter to return a Boolean result. 171 | 172 | ```dos 173 | PS C:\> Test-WGVersion -Quiet 174 | False 175 | ``` 176 | 177 | ## Localization 178 | 179 | Beginning 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`. 180 | 181 | If you encounter problems running module commands under a different culture, please post an issue. Include the output from these commands. 182 | 183 | ```powershell 184 | winget show --id microsoft.powershell --source winget 185 | Get-Culture 186 | ``` 187 | 188 | I'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. 189 | 190 | ## Issues 191 | 192 | If there are problems with commands in this module, try running the winget command directly. Report problems to the module's Github repository at . 193 | 194 | Visit the winget Github repository for more information about the project at . 195 | -------------------------------------------------------------------------------- /WingetTools.psd1: -------------------------------------------------------------------------------- 1 | # 2 | # Module manifest for module 'WingetTools' 3 | # 4 | 5 | @{ 6 | 7 | RootModule = 'WingetTools.psm1' 8 | ModuleVersion = '1.7.0' 9 | CompatiblePSEditions = @('Desktop', 'Core') 10 | GUID = '1130bb85-58d1-487d-9763-c38011f9613d' 11 | Author = 'Jeff Hicks' 12 | CompanyName = 'JDH Information Technology Solutions, Inc.' 13 | Copyright = '2021-2023 JDH Information Technology Solutions, Inc.' 14 | Description = 'A set of PowerShell tools for working with the winget package manager.' 15 | PowerShellVersion = '5.1' 16 | 17 | # Type files (.ps1xml) to be loaded when importing this module 18 | TypesToProcess = @("types\wginstalled.types.ps1xml") 19 | RequiredModules = @("ThreadJob", "psyml") 20 | 21 | FormatsToProcess = @( 22 | 'formats\wgpackage.format.ps1xml', 23 | 'formats\wgversion.format.ps1xml', 24 | 'formats\wingetupgrade.format.ps1xml', 25 | 'formats\wginstalled.format.ps1xml' 26 | ) 27 | FunctionsToExport = 'Get-WGPackage', 'Install-Winget', 'Get-WGReleaseNote', 28 | 'Get-WGInstalled', 'Invoke-WGUpgrade', 'Get-WGUpgrade', 'Test-WGVersion' , 'Get-WGPath' 29 | AliasesToExport = 'wglatest', 'iwg' 30 | PrivateData = @{ 31 | PSData = @{ 32 | Tags = @('winget', 'packagemanagement') 33 | LicenseUri = 'https://github.com/jdhitsolutions/WingetTools/blob/main/LICENSE.txt' 34 | ProjectUri = 'https://github.com/jdhitsolutions/WingetTools' 35 | # IconUri = '' 36 | ReleaseNotes = 'https://github.com/jdhitsolutions/WingetTools/blob/main/README.md' 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /WingetTools.psm1: -------------------------------------------------------------------------------- 1 | #region define a class 2 | 3 | Class wgBase { 4 | [string]$Name 5 | [string]$ID 6 | [string]$Version 7 | [string]$Source = "winget" 8 | [string]$Computername = $env:COMPUTERNAME 9 | } 10 | 11 | Class wgPackage:wgBase { 12 | [string]$Moniker 13 | [string]$Description 14 | [string]$Author 15 | [string]$Publisher 16 | [string]$PublisherUrl 17 | [string]$PublisherSupportUrl 18 | [string]$Homepage 19 | } 20 | 21 | Class wgInstalled:wgPackage { 22 | [string]$InstalledVersion 23 | } 24 | 25 | class wgUpgrade:wgBase { 26 | [string]$Available 27 | [string]$Source = "winget" 28 | 29 | wgUpgrade($Name, $ID, $version, $available) { 30 | $this.name = $Name 31 | $this.ID = $ID 32 | $this.version = $version 33 | $this.available = $available 34 | } 35 | } 36 | 37 | Update-TypeData -TypeName wgInstalled -MemberType AliasProperty -MemberName OnlineVersion -Value Version -force 38 | 39 | #region Main 40 | 41 | Get-ChildItem -Path $PSScriptroot\functions\*.ps1 | 42 | ForEach-Object { . $_.Fullname } 43 | 44 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 45 | 46 | #endregion 47 | 48 | #load localized data 49 | Try { 50 | Import-LocalizedData -BindingVariable localized -FileName localized.psd1 -ErrorAction Stop 51 | 52 | # write-host "Imported localized data for $(Get-Culture)" -ForegroundColor green 53 | # $localized | out-string | write-host -ForegroundColor green 54 | } 55 | Catch { 56 | Import-LocalizedData -BindingVariable localized -FileName localized.psd1 -UICulture en-US 57 | } 58 | 59 | -------------------------------------------------------------------------------- /de-DE/about_wingettools.txt: -------------------------------------------------------------------------------- 1 | # WingetTools 2 | 3 | ## about_WingetTools 4 | 5 | # KURZE BESCHREIBUNG 6 | 7 | Das Wingettools-Modul ist ein PowerShell-Wrapper um das Winget-Befehlszeilentool. 8 | 9 | # LANGE BESCHREIBUNG 10 | 11 | Das Befehlszeilentool winget ist der neueste Paketmanager und Installer von Microsoft. Es ist ein Befehlszeilentool, kein PowerShell-Befehl. Die Befehle im WingetTools-Modul wurden entwickelt, um die Verwendung von winget etwas PowerShell-freundlicher zu gestalten. 12 | 13 | ## Install-WinGet 14 | 15 | Bis winget öffentlich im Microsoft Store verfügbar ist, können Sie die neueste Version von Github herunterladen und installieren. Dieser Befehl muss in einer Windows PowerShell-Sitzung in Windows 10 oder Windows 11 ausgeführt werden. Das Paket erfordert die DesktopAppInstaller-Paket. Wenn es nicht gefunden wird, wird es heruntergeladen und installiert. 16 | 17 | ## Get-WGReleaseNote 18 | 19 | Dieser Befehl fragt das Github-Repository nach dem Winget-Projekt ab und zeigt die Versionshinweise für die neueste Version an. Sie können es auch im Markdown-Format anzeigen oder zur Online-Version gehen. 20 | 21 | ## Get-WGPackage 22 | 23 | Dieser Befehl ist ein PowerShell-Wrapper um winget.cmd, der ein Paket abruft und ein Objekt erstellt, das Sie in PowerShell verwenden können. Das Objekt hat eine standardmäßige Tabellenansicht, aber das Objekt hat andere Eigenschaften. 24 | 25 | Name: GitHub-CLI 26 | ID: GitHub.cli 27 | Version: 2.0.0 28 | Herausgeber : GitHub, Inc. 29 | Autor: GitHub, Inc. 30 | Spitzname: gh 31 | Beschreibung : Offizielles Befehlszeilentool von GitHubs. 32 | Homepage: https://github.com/cli/cli 33 | Lizenz: MIT-Lizenz 34 | Lizenz-URL: https://github.com/cli/cli/blob/HEAD/LICENSE 35 | Typ: Msi 36 | Gebietsschema: en-US 37 | Download-URL: https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_windows_amd64.msi 38 | SHA256: 09761ebfcf1a294b79cf5c820d2a51edca9d5e515cbd1036c45862c462b36189 39 | 40 | Wenn Sie Details zu mehreren Paketen abrufen möchten, leiten Sie einen Winget-Suchbefehl an diesen PowerShell-Befehl weiter. 41 | 42 | winget search --tag github --source winget | Get-WGPackage 43 | 44 | ## Get-WGInstalliert 45 | 46 | Dieser Befehl ruft eine Liste aller Pakete ab, die mit winget installiert wurden. Dies sind Pakete mit Winget als Quelle. 47 | 48 | ## Get-WGUpgrade 49 | 50 | Dieser Befehl erleichtert das Abrufen von PowerShell-Objekten, die Upgradepakete widerspiegeln. Der Befehl schreibt ein benutzerdefiniertes Objekt in die Pipeline, das standardmäßig als Tabelle formatiert ist. Sie können diesen Befehl verwenden, um in einer ForEach-Schleife zu winget.exe zu leiten, um ein Upgrade durchzuführen, oder zu Invoke-WGUpgrade, das -WhatIf unterstützt. 51 | 52 | ## Invoke-WGUpgrade 53 | 54 | Dieser Befehl ist ein Wrapper um die Winget-Upgrade-Option. Das Upgrade erfolgt mithilfe der Paket-ID und der Optionen für die unbeaufsichtigte Installation. Das Upgrade akzeptiert auch alle Lizenzen und Vereinbarungen. 55 | 56 | # FEHLERBEHEBUNG HINWEIS 57 | 58 | Wenn es Probleme mit Befehlen in diesem Modul gibt, versuchen Sie, den Befehl winget direkt auszuführen. Melden Sie Probleme im Github-Repository des Moduls unter https://github.com/jdhitsolutions/WingetTools/issues. 59 | 60 | # SIEHE AUCH 61 | 62 | Besuchen Sie das winget Github-Repository für weitere Informationen über das Projekt unter https://github.com/microsoft/winget-cli. 63 | 64 | # SCHLÜSSELWÖRTER 65 | 66 | - Flügel 67 | - Pakete -------------------------------------------------------------------------------- /de-DE/localized.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Found = "Gefunden" 3 | Name = "Name" 4 | ID = "ID" 5 | Version = "Version" 6 | Publisher = "Herausgeber" 7 | PublisherUrl = "Herausgeber-URL" 8 | PublisherSupportUrl = "Herausgeber-Support-URL" 9 | Author = "Autor" 10 | Moniker = "Moniker" 11 | Description = "Beschreibung" 12 | Homepage = "Startseite" 13 | License = "Lizenz" 14 | LicenseURL = "Lizenz-URL" 15 | Source = "Source" 16 | Computername = "Computername" 17 | } -------------------------------------------------------------------------------- /docs-DE/Get-WGInstalled.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3Ci70lz 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGInstalled 9 | 10 | ## SYNOPSIS 11 | 12 | Get packages installed with winget. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGInstalled [[-Source] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Dieser Befehl ruft eine Liste aller Pakete ab, die mit winget installiert wurden. Dies sind Pakete, die von Winget bezogen werden. Dieser Befehl muss überarbeitet werden, wenn mehr Quellen verfügbar werden. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGInstalled -outvariable in 30 | 31 | Name ID Version Description 32 | ---- -- ------- ----------- 33 | Visual Studio Community Microsoft.VisualStudio.20 16.11.10 The Community edition of Visual Studio, an 34 | 2019 19.Community integrated development environment (IDE) from 35 | Microsoft. Individual developers have no 36 | restrictions on their use of the Community 37 | edition. 38 | Audacity Audacity.Audacity 3.1.3 Audacity is a free, easy-to-use, multi-track 39 | audio editor and recorder for Windows, macOS, 40 | GNU/Linux and other operating systems. 41 | Ubuntu Canonical.Ubuntu 2004.2021.825.0 Ubuntu on Windows allows you to use Ubuntu 42 | Terminal and run Ubuntu command line 43 | utilities including bash, ssh, git, apt and 44 | many more. This is the latest LTS release. 45 | CCleaner Piriform.CCleaner 6.00 CCleaner is a utility used to clean 46 | potentially unwanted files and invalid 47 | Windows Registry entries from a computer. 48 | ... 49 | ``` 50 | 51 | Aufgrund des Verarbeitungsaufwands wird empfohlen, die Ergebnisse in einer Variablen zu speichern. 52 | 53 | ### Example 2 54 | 55 | ```powershell 56 | PS C\> $in | format-table -view update 57 | 58 | ID InstalledVersion OnlineVersion Update 59 | -- ---------------- ------------- ------ 60 | Microsoft.VisualStudio.2019.Community 16.11.10 16.11.17 True 61 | Audacity.Audacity 3.1.3 3.1.3 False 62 | Piriform.CCleaner 6.00 6.01 True 63 | Canonical.Ubuntu 2004.2021.825.0 2004.2021.825.0 False 64 | Discord.Discord 1.0.9003 1.0.9005 True 65 | Foxit.FoxitReader 12.0.0.12394 12.0.1.12430 True 66 | Git.Git 2.37.1 2.37.1 False 67 | ``` 68 | 69 | Es gibt eine benannte Tabellenansicht, die Sie verwenden können, um potenzielle Aktualisierungen schnell zu identifizieren. 70 | 71 | ## PARAMETERS 72 | 73 | ### -Source 74 | 75 | Geben Sie eine Winget-Quelle an. Derzeit gibt es wirklich nur eine einzige Quelle, aber dies könnte sich irgendwann ändern. 76 | 77 | ```yaml 78 | Type: String 79 | Parameter Sets: (All) 80 | Aliases: 81 | 82 | Required: False 83 | Position: 0 84 | Default value: winget 85 | Accept pipeline input: False 86 | Accept wildcard characters: False 87 | ``` 88 | 89 | ### CommonParameters 90 | 91 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 92 | 93 | ## INPUTS 94 | 95 | ### None 96 | 97 | ## OUTPUTS 98 | 99 | ### wgPackage 100 | 101 | ## NOTES 102 | 103 | Learn more about PowerShell: 104 | http://jdhitsolutions.com/blog/essential-powershell-resources/learn 105 | 106 | ## RELATED LINKS 107 | 108 | [Get-WGPackage](Get-WGPackage.md) 109 | 110 | [Get-WGUpgrade](Get-WGUpgrade.md) 111 | -------------------------------------------------------------------------------- /docs-DE/Get-WGPackage.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3K5FR7f 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGPackage 9 | 10 | ## SYNOPSIS 11 | 12 | Informieren Sie sich über ein Winget-Paket 13 | 14 | ## SYNTAX 15 | 16 | ### name (Default) 17 | 18 | ```yaml 19 | Get-WGPackage [[-Name] ] [-Source ] [] 20 | ``` 21 | 22 | ### id 23 | 24 | ```yaml 25 | Get-WGPackage [-ID ] [-Source ] [] 26 | ``` 27 | 28 | ### moniker 29 | 30 | ```yaml 31 | Get-WGPackage [-Moniker ] [-Source ] [] 32 | ``` 33 | 34 | ### input 35 | 36 | ```yaml 37 | Get-WGPackage [-InputObject ] [-Source ] [] 38 | ``` 39 | 40 | ## DESCRIPTION 41 | 42 | Dieser Befehl ist ein PowerShell-Wrapper um winget.command, der ein Paket abruft und ein Objekt erstellt, das Sie in PowerShell verwenden können. 43 | 44 | ## EXAMPLES 45 | 46 | ### Example 1 47 | 48 | ```powershell 49 | PS C:\> Get-WGPackage -name "Foxit PDF Reader" 50 | 51 | Name ID Version Description 52 | ---- -- ------- ----------- 53 | Foxit PDF Reader Foxit.FoxitReader 11.2.1.53537 Foxit is a powerful PDF reader 54 | for viewing, filling out forms 55 | and more. 56 | ``` 57 | 58 | Holen Sie sich ein Paket mit seinem Namen. 59 | 60 | ### Example 2 61 | 62 | ```powershell 63 | PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object * 64 | 65 | Name : PowerShell Preview 66 | ID : Microsoft.PowerShell.Preview 67 | Version : 7.3.0.3 68 | Publisher : Microsoft Corporation 69 | Publisher URL : https://github.com/PowerShell/PowerShell 70 | Publisher Support URL : https://github.com/PowerShell/PowerShell/issues 71 | Author : Microsoft Corporation 72 | Moniker : pwsh-preview 73 | Description : PowerShell is a cross-platform (Windows, Linux, and 74 | macOS) automation and configuration tool/framework that 75 | works well with your existing tools and is optimized 76 | for dealing with structured data (e.g. JSON, CSV, XML, 77 | etc.), REST APIs, and object models. 78 | Homepage : https://microsoft.com/PowerShell 79 | ``` 80 | 81 | Die Ausgabe ist ein reichhaltiges Objekt. 82 | 83 | ### Example 3 84 | 85 | ```powershell 86 | PS C:\> winget search --tag powerbi | Get-WGPackage | Select-Object Name,ID,Version 87 | 88 | 89 | Name ID Version 90 | ---- -- ------- 91 | DAX Studio DaxStudio.DaxStudio 2.17.3.683 92 | Microsoft PowerBI Desktop Microsoft.PowerBI 2.102.845.0 93 | ``` 94 | 95 | Sie können die Ergebnisse eines Winget-Suchbefehls an diese Funktion weiterleiten. 96 | 97 | ## PARAMETERS 98 | 99 | ### -ID 100 | 101 | Specify the package ID. 102 | 103 | ```yaml 104 | Type: String 105 | Parameter Sets: id 106 | Aliases: 107 | 108 | Required: False 109 | Position: Named 110 | Default value: None 111 | Accept pipeline input: True (ByPropertyName) 112 | Accept wildcard characters: False 113 | ``` 114 | 115 | ### -InputObject 116 | 117 | Leiten Sie eine Winget-Suche an diese Funktion weiter. 118 | 119 | ```yaml 120 | Type: String[] 121 | Parameter Sets: input 122 | Aliases: 123 | 124 | Required: False 125 | Position: Named 126 | Default value: None 127 | Accept pipeline input: True (ByValue) 128 | Accept wildcard characters: False 129 | ``` 130 | 131 | ### -Moniker 132 | 133 | Geben Sie den Winget-Moniker an. 134 | 135 | ```yaml 136 | Type: String 137 | Parameter Sets: moniker 138 | Aliases: 139 | 140 | Required: False 141 | Position: Named 142 | Default value: None 143 | Accept pipeline input: False 144 | Accept wildcard characters: False 145 | ``` 146 | 147 | ### -Name 148 | 149 | Geben Sie den Winget-Paketnamen an. 150 | 151 | ```yaml 152 | Type: String 153 | Parameter Sets: name 154 | Aliases: 155 | 156 | Required: False 157 | Position: 0 158 | Default value: None 159 | Accept pipeline input: True (ByPropertyName) 160 | Accept wildcard characters: False 161 | ``` 162 | 163 | ### -Source 164 | 165 | Geben Sie eine Winget-Quelle an. Derzeit gibt es wirklich nur eine einzige Quelle, aber dies könnte sich irgendwann ändern. 166 | 167 | ```yaml 168 | Type: String 169 | Parameter Sets: (All) 170 | Aliases: 171 | 172 | Required: False 173 | Position: Named 174 | Default value: winget 175 | Accept pipeline input: False 176 | Accept wildcard characters: False 177 | ``` 178 | 179 | ### CommonParameters 180 | 181 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 182 | 183 | ## INPUTS 184 | 185 | ### System.String[] 186 | 187 | ## OUTPUTS 188 | 189 | ### WGPackage 190 | 191 | ## NOTES 192 | 193 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 194 | 195 | ## RELATED LINKS 196 | 197 | [Get-WGInstalled](Get-WGInstalled.md) 198 | -------------------------------------------------------------------------------- /docs-DE/Get-WGPath.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3QA0jQ5 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGPath 9 | 10 | ## SYNOPSIS 11 | 12 | Rufen Sie den Pfad der ausführbaren Winget-Datei ab 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGPath [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Normalerweise werden Sie winget in Ihrem Benutzerkontext ausführen. Wenn Sie winget jedoch im Systemkontext ausführen, kann dieses Konto winget.exe nicht finden. Dieser Befehl gibt je nach Benutzerkontext den vollständigen Pfad zur Datei winget.exe zurück. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGPath 30 | C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\Winget.exe 31 | ``` 32 | 33 | ## PARAMETERS 34 | 35 | ### CommonParameters 36 | 37 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 38 | 39 | ## INPUTS 40 | 41 | ### None 42 | 43 | ## OUTPUTS 44 | 45 | ### System.String 46 | 47 | ## NOTES 48 | 49 | ## RELATED LINKS 50 | -------------------------------------------------------------------------------- /docs-DE/Get-WGReleaseNote.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3CfeCp5 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGReleaseNote 9 | 10 | ## SYNOPSIS 11 | 12 | Holen Sie sich die neuesten Versionshinweise für winget. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGReleaseNote [-AsMarkdown] [-Online] [-Preview] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Dieser Befehl fragt das Github-Repository nach dem Winget-Projekt ab und zeigt die Versionshinweise für die neueste Version an. Sie können es auch im Markdown-Format anzeigen oder zur Online-Version gehen. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGReleaseNote 30 | 31 | Name : Windows Package Manager v1.1.12653 32 | Version : v1.1.12653 33 | Published : 9/27/2021 6:08:01 PM 34 | Prerelease : False 35 | Notes : This release represents our Windows Package Manager 1.release 36 | candidate build for Windows 10 (1809+). 37 | 38 | Experimental features have been disabled in this release. We will 39 | follow this release with another Pre-release "developer" 40 | build at GitHub so users can continue with experimental features 41 | available. 42 | 43 | # Bugs 44 | #797 Silent install of "winget install git.git" is not working 45 | #1497 Make rename retry more frequently for longer, then try 46 | making a hardlink 47 | Link : https://github.com/microsoft/winget-cli/releases/tag/v1.1.12653 48 | ``` 49 | 50 | Die Standardausgabe. 51 | 52 | ### Example 2 53 | 54 | ```powershell 55 | PS C:\> Get-WGReleaseNote -asmarkdown | Show-Markdown 56 | ``` 57 | 58 | Bei Ausführung in PowerShell 7 können Sie die Markdown-Cmdlets verwenden. 59 | 60 | ### Example 3 61 | 62 | ```powershell 63 | PS C:\> Get-WGReleaseNote | Select-Object Name,Version,Published 64 | 65 | Name Version Published 66 | ---- ------- --------- 67 | Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM 68 | ``` 69 | 70 | Die Ausgabe ist ein Objekt. 71 | 72 | ### Example 4 73 | 74 | ```powershell 75 | PS C:\> Get-WGReleaseNote -Preview 76 | 77 | 78 | Name : Windows Package Manager v1.1.12701 79 | Version : v1.1.12701 80 | Published : 9/28/2021 10:30:01 AM 81 | Prerelease : True 82 | Notes : This release is the first development build after the Windows 83 | Package Manager 1.1 release candidate build for Windows 10 84 | (1809+). 85 | 86 | Experimental features have been enabled in this release. This 87 | build will be released to Windows Insider Dev builds, and 88 | Windows Package Manager Insiders. 89 | ``` 90 | 91 | Holen Sie sich die Versionshinweise für die neueste Vorschau. 92 | 93 | ## PARAMETERS 94 | 95 | ### -AsMarkdown 96 | 97 | Erstellen Sie ein Markdown-Dokument. 98 | 99 | ```yaml 100 | Type: SwitchParameter 101 | Parameter Sets: (All) 102 | Aliases: md 103 | 104 | Required: False 105 | Position: Named 106 | Default value: None 107 | Accept pipeline input: False 108 | Accept wildcard characters: False 109 | ``` 110 | 111 | ### -Online 112 | 113 | Öffnen Sie den Speicherort der Versionshinweise online mit Ihrem Standard-Webbrowser. 114 | 115 | ```yaml 116 | Type: SwitchParameter 117 | Parameter Sets: (All) 118 | Aliases: 119 | 120 | Required: False 121 | Position: Named 122 | Default value: None 123 | Accept pipeline input: False 124 | Accept wildcard characters: False 125 | ``` 126 | 127 | ### -Preview 128 | 129 | Holen Sie sich die neueste Vorschauversion. 130 | 131 | ```yaml 132 | Type: SwitchParameter 133 | Parameter Sets: (All) 134 | Aliases: 135 | 136 | Required: False 137 | Position: Named 138 | Default value: None 139 | Accept pipeline input: False 140 | Accept wildcard characters: False 141 | ``` 142 | 143 | ### CommonParameters 144 | 145 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 146 | 147 | ## INPUTS 148 | 149 | ### None 150 | 151 | ## OUTPUTS 152 | 153 | ### System.String 154 | 155 | ### WGReleaseNote 156 | 157 | ## NOTES 158 | 159 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 160 | 161 | ## RELATED LINKS 162 | 163 | [Install-WinGet](Install-WinGet.md) 164 | 165 | [Test-WGVersion](Test-WGVersion.md) 166 | -------------------------------------------------------------------------------- /docs-DE/Get-WGUpgrade.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3dIagfW 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGUpgrade 9 | 10 | ## SYNOPSIS 11 | 12 | Erhalten Sie verfügbare Winget-Upgrades. 13 | 14 | ## SYNTAX 15 | 16 | ### Name (Default) 17 | 18 | ```yaml 19 | Get-WGUpgrade [-Name ] [] 20 | ``` 21 | 22 | ### ID 23 | 24 | ```yaml 25 | Get-WGUpgrade [-ID ] [] 26 | ``` 27 | 28 | ## DESCRIPTION 29 | 30 | Verwenden Sie diesen Befehl, um Informationen über verfügbare Winget-Upgrades zu erhalten. Sie können dann manuell entscheiden, was aktualisiert werden soll, indem Sie „winget“ oder „Pipe to Invoke-WingetUpgrade“ verwenden. Die Ausgabe zeigt keine Pakete an, bei denen die installierte Version nicht ermittelt werden kann. 31 | 32 | ## EXAMPLES 33 | 34 | ### Example 1 35 | 36 | ```powershell 37 | PS C:\> Get-WGUpgrade 38 | 39 | Name ID Installed Available 40 | ---- -- --------- --------- 41 | Visual Studio Community Microsoft.VisualStudio.2019.Community 16.11.10 16.11.17 42 | 2019 43 | CCleaner Piriform.CCleaner 6.00 6.01 44 | Discord Discord.Discord 1.0.9003 1.0.9005 45 | Foxit PDF Reader Foxit.FoxitReader 12.0.0.12394 12.0.1.12430 46 | Notepad++ Notepad++.Notepad++ 8.3.3 8.4.4 47 | ... 48 | ``` 49 | 50 | Holen Sie sich alle verfügbaren Updates. 51 | 52 | ### Example 2 53 | 54 | ```powershell 55 | PS C:\> get-wgupgrade p* 56 | 57 | Name ID Installed Available 58 | ---- -- --------- --------- 59 | PowerToys (Preview) Microsoft.PowerToys 0.58.0 0.61.1 60 | Python 3 Python.Python.3 3.10.3 3.10.6 61 | ``` 62 | 63 | Erhalten Sie Upgrades mit einem Namen, der mit P beginnt. 64 | 65 | ### Example 3 66 | 67 | ```powershell 68 | PS C:\> Get-WGUpgrade -id micro* | Select-Object Name,Version,Available 69 | 70 | Name Version Available 71 | ---- ------- --------- 72 | Visual Studio Community 2019 16.11.10 16.11.17 73 | Microsoft Visual C++ 2015-2022 Redistributable (x86) 14.31.31103.0 14.32.31332.0 74 | Microsoft .NET SDK 3.1 3.1.419 3.1.421 75 | PowerToys (Preview) 0.58.0 0.61.1 76 | Microsoft Visual C++ 2015-2022 Redistributable (x86) 14.32.31326.0 14.32.31332.0 77 | 78 | ``` 79 | 80 | Erhalten Sie Upgrades nach ID, die mit „micro“ beginnt. Beachten Sie, dass sich der eigentliche Objekteigenschaftsname „Version“ von der formatierten Spaltenüberschrift „Installiert“ unterscheidet. 81 | 82 | ## PARAMETERS 83 | 84 | ### -ID 85 | 86 | Geben Sie ein Paket nach ID an. Wildcards sind erlaubt. 87 | 88 | ```yaml 89 | Type: String 90 | Parameter Sets: ID 91 | Aliases: 92 | 93 | Required: False 94 | Position: Named 95 | Default value: None 96 | Accept pipeline input: False 97 | Accept wildcard characters: False 98 | ``` 99 | 100 | ### -Name 101 | 102 | Geben Sie ein Paket nach Namen an. Wildcards sind erlaubt. 103 | 104 | ```yaml 105 | Type: String 106 | Parameter Sets: Name 107 | Aliases: 108 | 109 | Required: False 110 | Position: Named 111 | Default value: None 112 | Accept pipeline input: False 113 | Accept wildcard characters: False 114 | ``` 115 | 116 | ### CommonParameters 117 | 118 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 119 | 120 | ## INPUTS 121 | 122 | ### None 123 | 124 | ## OUTPUTS 125 | 126 | ### wgUpgrade 127 | 128 | ## NOTES 129 | 130 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 131 | 132 | ## RELATED LINKS 133 | 134 | [Invoke-WGUpgrade](Invoke-WGUpgrade.md) 135 | 136 | [Get-WGInstalled](Get-WGInstalled.md) 137 | -------------------------------------------------------------------------------- /docs-DE/Install-WinGet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3A5B7tT 5 | schema: 2.0.0 6 | --- 7 | 8 | # Install-WinGet 9 | 10 | ## SYNOPSIS 11 | 12 | Installieren Sie die neueste Winget-Version von Github. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Install-WinGet [-Preview] [-Passthru] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Bis winget öffentlich im Microsoft Store verfügbar ist, können Sie die neueste Version von Github herunterladen und installieren. Dieser Befehl muss in einer Windows PowerShell-Sitzung unter Windows 10 oder Windows 11 ausgeführt werden. Das Paket erfordert das Paket Microsoft.VCLibs.140.00.UWPDesktop. Wenn es nicht gefunden wird, wird es heruntergeladen und installiert. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Install-Winget 30 | ``` 31 | 32 | ## PARAMETERS 33 | 34 | ### -Confirm 35 | 36 | Fordert Sie zur Bestätigung auf, bevor das Cmdlet ausgeführt wird. 37 | 38 | ```yaml 39 | Type: SwitchParameter 40 | Parameter Sets: (All) 41 | Aliases: cf 42 | 43 | Required: False 44 | Position: Named 45 | Default value: False 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -Passthru 51 | 52 | Zeigen Sie das AppxPackage nach der Installation an. 53 | 54 | ```yaml 55 | Type: SwitchParameter 56 | Parameter Sets: (All) 57 | Aliases: 58 | 59 | Required: False 60 | Position: Named 61 | Default value: False 62 | Accept pipeline input: False 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### -WhatIf 67 | 68 | Zeigt, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt. 69 | 70 | ```yaml 71 | Type: SwitchParameter 72 | Parameter Sets: (All) 73 | Aliases: wi 74 | 75 | Required: False 76 | Position: Named 77 | Default value: False 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### -Preview 83 | 84 | Installieren Sie den neuesten Vorschau-Build. 85 | 86 | ```yaml 87 | Type: SwitchParameter 88 | Parameter Sets: (All) 89 | Aliases: 90 | 91 | Required: False 92 | Position: Named 93 | Default value: None 94 | Accept pipeline input: False 95 | Accept wildcard characters: False 96 | ``` 97 | 98 | ### CommonParameters 99 | 100 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 101 | 102 | ## INPUTS 103 | 104 | ### None 105 | 106 | ## OUTPUTS 107 | 108 | ### None 109 | 110 | ### AppxPackage 111 | 112 | ## NOTES 113 | 114 | Learn more about PowerShell: 115 | http://jdhitsolutions.com/blog/essential-powershell-resources/ 116 | 117 | ## RELATED LINKS 118 | 119 | [Get-WGReleaseNote](Get-WGReleaseNote.md) 120 | -------------------------------------------------------------------------------- /docs-DE/Invoke-WGUpgrade.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3SVsASZ 5 | schema: 2.0.0 6 | --- 7 | 8 | # Invoke-WGUpgrade 9 | 10 | ## SYNOPSIS 11 | 12 | Rufen Sie ein Winget-Upgrade für alle verfügbaren Upgrades auf. 13 | 14 | ## SYNTAX 15 | 16 | ### id (Default) 17 | 18 | ```yaml 19 | Invoke-WGUpgrade -ID [-WhatIf] [-Confirm] [] 20 | ``` 21 | 22 | ### input 23 | 24 | ```yaml 25 | Invoke-WGUpgrade [-InputObject ] [-WhatIf] [-Confirm] [] 26 | ``` 27 | 28 | ### all 29 | 30 | ```yaml 31 | Invoke-WGUpgrade [-All] [-IncludeUnknown] [-WhatIf] [-Confirm] [] 32 | ``` 33 | 34 | ## DESCRIPTION 35 | 36 | Dieser Befehl wurde entwickelt, um das Upgrade von Winget-Paketen zu vereinfachen. Der Befehl überspringt Pakete mit unbekannten Versionen. Der Installationsprozess akzeptiert alle Lizenzen und Vereinbarungen und verwendet die Silent-Winget-Option. 37 | 38 | Beachten Sie, dass winget beim Versuch, das Update aufzurufen, immer noch auf ein Problem stoßen kann. 39 | 40 | ## EXAMPLES 41 | 42 | ### Example 1 43 | 44 | ```powershell 45 | PS C:\> Invoke-WGUpgrade -id Microsoft.VC++2015-2019Redist-x64 46 | 47 | Found Microsoft Visual C++ 2015-2019 Redistributable (x64) [Microsoft.VC++2015-2019Redist-x64] Version 14.29.30135.0 48 | This application is licensed to you by its owner. 49 | Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. 50 | Downloading https://download.visualstudio.microsoft.com/download/pr/d3cbdace-2bb8-4dc5-a326-2c1c0f1ad5ae/9B9DD72C27AB1DB081DE56BB7B73BEE9A00F60D14ED8E6FDE45DAB3E619B5F04/VC_redist.x64.exe 51 | Successfully verified installer hash 52 | Starting package install... 53 | Successfully installed 54 | ``` 55 | 56 | ### Example 2 57 | 58 | ```powershell 59 | PS C:\> Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf 60 | What if: Performing the operation "Upgrade from 3.2.0+06857 to 3.3.1+06924" on target "PrivateInternetAccess.PrivateInternetAccess". 61 | What if: Performing the operation "Upgrade from 0.58.0 to 0.61.1" on target "Microsoft.PowerToys". 62 | What if: Performing the operation "Upgrade from 3.10.3 to 3.10.6" on target "Python.Python.3". 63 | ``` 64 | 65 | Sie können die Ausgabe von Get-WGUpgrade an diesen Befehl weiterleiten. 66 | 67 | ### Example 3 68 | 69 | ```powershell 70 | PS C:\> Get-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade 71 | ``` 72 | 73 | Leiten Sie die Liste der verfügbaren Upgrades an Out-Gridview weiter, wo Sie Elemente auswählen können. Invoke-WGUpgrade installiert dann die ausgewählten Upgrades. 74 | 75 | ### Example 4 76 | 77 | ```powershell 78 | PS C:\> Invoke-WGUpgrade -all 79 | ``` 80 | 81 | Dies ist das Äquivalent zum Ausführen von winget upgrade --all. 82 | 83 | ## PARAMETERS 84 | 85 | ### -Confirm 86 | 87 | Fordert Sie zur Bestätigung auf, bevor das Cmdlet ausgeführt wird. 88 | 89 | ```yaml 90 | Type: SwitchParameter 91 | Parameter Sets: (All) 92 | Aliases: cf 93 | 94 | Required: False 95 | Position: Named 96 | Default value: None 97 | Accept pipeline input: False 98 | Accept wildcard characters: False 99 | ``` 100 | 101 | ### -WhatIf 102 | 103 | Zeigt, was passieren würde, wenn das Cmdlet ausgeführt wird. 104 | Das Cmdlet wird nicht ausgeführt. 105 | 106 | ```yaml 107 | Type: SwitchParameter 108 | Parameter Sets: (All) 109 | Aliases: wi 110 | 111 | Required: False 112 | Position: Named 113 | Default value: None 114 | Accept pipeline input: False 115 | Accept wildcard characters: False 116 | ``` 117 | 118 | ### -ID 119 | 120 | Geben Sie ein Paket nach ID an. Wildcards sind erlaubt. 121 | 122 | ```yaml 123 | Type: String 124 | Parameter Sets: id 125 | Aliases: 126 | 127 | Required: True 128 | Position: Named 129 | Default value: None 130 | Accept pipeline input: False 131 | Accept wildcard characters: False 132 | ``` 133 | 134 | ### -InputObject 135 | 136 | Geben Sie ein wgUpgrade-Objekt an. 137 | 138 | ```yaml 139 | Type: Object 140 | Parameter Sets: input 141 | Aliases: 142 | 143 | Required: False 144 | Position: Named 145 | Default value: None 146 | Accept pipeline input: True (ByValue) 147 | Accept wildcard characters: False 148 | ``` 149 | 150 | ### -All 151 | 152 | Update all packages. 153 | 154 | ```yaml 155 | Type: SwitchParameter 156 | Parameter Sets: all 157 | Aliases: 158 | 159 | Required: False 160 | Position: Named 161 | Default value: None 162 | Accept pipeline input: False 163 | Accept wildcard characters: False 164 | ``` 165 | 166 | ### -IncludeUnknown 167 | 168 | Aktualisieren Sie Pakete, auch wenn ihre aktuelle Version nicht ermittelt werden kann. Dies erfordert den Parameter -All. 169 | 170 | ```yaml 171 | Type: SwitchParameter 172 | Parameter Sets: all 173 | Aliases: 174 | 175 | Required: False 176 | Position: Named 177 | Default value: None 178 | Accept pipeline input: False 179 | Accept wildcard characters: False 180 | ``` 181 | 182 | ### CommonParameters 183 | 184 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 185 | 186 | ## INPUTS 187 | 188 | ### None 189 | 190 | ## OUTPUTS 191 | 192 | ### None 193 | 194 | ## NOTES 195 | 196 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 197 | 198 | ## RELATED LINKS 199 | 200 | [Get-WGUpgrade](Get-WGUpgrade.md) 201 | 202 | [Get-WGInstalled](Get-WGInstalled.md) 203 | -------------------------------------------------------------------------------- /docs-DE/Test-WGVersion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3T1zC8I 5 | schema: 2.0.0 6 | --- 7 | 8 | # Test-WGVersion 9 | 10 | ## SYNOPSIS 11 | 12 | Testen Sie die Winget-Version. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Test-WGVersion [-Quiet] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Test-WGVersion ist ein einfacher Befehl, mit dem Sie feststellen können, ob Sie winget aktualisieren müssen. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Test-WGVersion 30 | 31 | Installed Online Update Command 32 | --------- ------ ------ ------- 33 | 1.1.13405 1.1.12653 False C:\Users\Jeff\AppData\Local\Microsoft\Windo… 34 | ``` 35 | 36 | Die Standardausgabe ist ein Objekt, das die aktuell installierte Version und die neueste stabile Version online anzeigt. Wenn ein Update verfügbar ist und Sie die PowerShell-Konsole oder VS Code ausführen, wird der Update-Wert in Grün angezeigt. 37 | 38 | ### Example 2 39 | 40 | ```powershell 41 | PS C:\> Test-WGVersion -Quiet 42 | False 43 | ``` 44 | 45 | Führen Sie den Test aus und erhalten Sie ein einfaches, boolesches Ergebnis, das angibt, ob ein Update verfügbar ist. 46 | 47 | ## PARAMETERS 48 | 49 | ### -Quiet 50 | 51 | Rufen Sie ein boolesches Ergebnis ab, das angibt, ob ein Update verfügbar ist. 52 | 53 | ```yaml 54 | Type: SwitchParameter 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: False 59 | Position: Named 60 | Default value: None 61 | Accept pipeline input: True (ByValue) 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### CommonParameters 66 | 67 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 68 | 69 | ## INPUTS 70 | 71 | ### System.Management.Automation.SwitchParameter 72 | 73 | ## OUTPUTS 74 | 75 | ### Boolean 76 | 77 | ### WGVersion 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | 83 | [Get-WGReleaseNote](Get-WGReleaseNote.md) 84 | -------------------------------------------------------------------------------- /docs/Get-WGInstalled.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/38Ps9nb 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGInstalled 9 | 10 | ## SYNOPSIS 11 | 12 | Get packages installed with winget. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGInstalled [[-Source] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | This command will get a list of all packages installed with winget. These will be packages with winget as the source. This command will have to be revised once more sources are available. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGInstalled -outvariable in 30 | 31 | Name ID Version Description 32 | ---- -- ------- ----------- 33 | Visual Studio Community Microsoft.VisualStudio.20 16.11.10 The Community edition of Visual Studio, an 34 | 2019 19.Community integrated development environment (IDE) from 35 | Microsoft. Individual developers have no 36 | restrictions on their use of the Community 37 | edition. 38 | Audacity Audacity.Audacity 3.1.3 Audacity is a free, easy-to-use, multi-track 39 | audio editor and recorder for Windows, macOS, 40 | GNU/Linux and other operating systems. 41 | Ubuntu Canonical.Ubuntu 2004.2021.825.0 Ubuntu on Windows allows you to use Ubuntu 42 | Terminal and run Ubuntu command line 43 | utilities including bash, ssh, git, apt and 44 | many more. This is the latest LTS release. 45 | CCleaner Piriform.CCleaner 6.00 CCleaner is a utility used to clean 46 | potentially unwanted files and invalid 47 | Windows Registry entries from a computer. 48 | ... 49 | ``` 50 | 51 | Because of the processing overhead, it is recommended that you save results to a variable. 52 | 53 | ### Example 2 54 | 55 | ```powershell 56 | PS C\> $in | format-table -view update 57 | 58 | ID InstalledVersion OnlineVersion Update 59 | -- ---------------- ------------- ------ 60 | Microsoft.VisualStudio.2019.Community 16.11.10 16.11.17 True 61 | Audacity.Audacity 3.1.3 3.1.3 False 62 | Piriform.CCleaner 6.00 6.01 True 63 | Canonical.Ubuntu 2004.2021.825.0 2004.2021.825.0 False 64 | Discord.Discord 1.0.9003 1.0.9005 True 65 | Foxit.FoxitReader 12.0.0.12394 12.0.1.12430 True 66 | Git.Git 2.37.1 2.37.1 False 67 | ``` 68 | 69 | There is a named table view you can use to quickly identify potential updates. 70 | 71 | ## PARAMETERS 72 | 73 | ### -Source 74 | 75 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 76 | 77 | ```yaml 78 | Type: String 79 | Parameter Sets: (All) 80 | Aliases: 81 | 82 | Required: False 83 | Position: 0 84 | Default value: winget 85 | Accept pipeline input: False 86 | Accept wildcard characters: False 87 | ``` 88 | 89 | ### CommonParameters 90 | 91 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 92 | 93 | ## INPUTS 94 | 95 | ### None 96 | 97 | ## OUTPUTS 98 | 99 | ### wgPackage 100 | 101 | ## NOTES 102 | 103 | Learn more about PowerShell: 104 | http://jdhitsolutions.com/blog/essential-powershell-resources/learn 105 | 106 | ## RELATED LINKS 107 | 108 | [Get-WGPackage](Get-WGPackage.md) 109 | 110 | [Get-WGUpgrade](Get-WGUpgrade.md) 111 | -------------------------------------------------------------------------------- /docs/Get-WGPackage.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3jQh9MH 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGPackage 9 | 10 | ## SYNOPSIS 11 | 12 | Get information about a winget package 13 | 14 | ## SYNTAX 15 | 16 | ### name (Default) 17 | 18 | ```yaml 19 | Get-WGPackage [[-Name] ] [-Source ] [] 20 | ``` 21 | 22 | ### id 23 | 24 | ```yaml 25 | Get-WGPackage [-ID ] [-Source ] [] 26 | ``` 27 | 28 | ### moniker 29 | 30 | ```yaml 31 | Get-WGPackage [-Moniker ] [-Source ] [] 32 | ``` 33 | 34 | ### input 35 | 36 | ```yaml 37 | Get-WGPackage [-InputObject ] [-Source ] [] 38 | ``` 39 | 40 | ## DESCRIPTION 41 | 42 | This command is a PowerShell wrapper around winget.cmd that will get a package and create an object you can use in PowerShell. 43 | 44 | ## EXAMPLES 45 | 46 | ### Example 1 47 | 48 | ```powershell 49 | PS C:\> Get-WGPackage -name "Foxit PDF Reader" 50 | 51 | Name ID Version Description 52 | ---- -- ------- ----------- 53 | Foxit PDF Reader Foxit.FoxitReader 12.0.1.12430 Foxit is a powerful PDF reader for viewing, filling out forms and more. 54 | ``` 55 | 56 | Get a package by its name. 57 | 58 | ### Example 2 59 | 60 | ```powershell 61 | PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object * 62 | 63 | Moniker : pwsh-preview 64 | Description : PowerShell is a cross-platform Windows, Linux, and macOS 65 | automation and configuration tool/frame work that works 66 | well with your existing tools and is optimized for 67 | dealing with structured data e.g. JSON, CSV, XML, etc., 68 | REST APIs, and object models. 69 | Author : Microsoft Corporation 70 | Publisher : Microsoft Corporation 71 | PublisherUrl : https://github.com/PowerShell/PowerShell 72 | PublisherSupportUrl : https://github.com/PowerShell/PowerShell/issues 73 | Homepage : https://microsoft.com/PowerShell 74 | Name : PowerShell Preview 75 | ID : Microsoft.PowerShell.Preview 76 | Version : 7.3.7.0 77 | Source : winget 78 | Computername : WIN11DESK 79 | ``` 80 | 81 | The output is a rich object. 82 | 83 | ### Example 3 84 | 85 | ```powershell 86 | PS C:\> winget search --tag powerbi | Get-WGPackage | Select-Object Name,ID,Version 87 | 88 | 89 | Name ID Version 90 | ---- -- ------- 91 | Microsoft PowerBI Desktop Microsoft.PowerBI 2.109.642.0 92 | DAX Studio DaxStudio.DaxStudio 3.0.0.725 93 | ``` 94 | 95 | You can pipe the results of a winget search command to this function. 96 | 97 | ## PARAMETERS 98 | 99 | ### -ID 100 | 101 | Specify the package ID. 102 | 103 | ```yaml 104 | Type: String 105 | Parameter Sets: id 106 | Aliases: 107 | 108 | Required: False 109 | Position: Named 110 | Default value: None 111 | Accept pipeline input: True (ByPropertyName) 112 | Accept wildcard characters: False 113 | ``` 114 | 115 | ### -InputObject 116 | 117 | Pipe a winget search to this function. 118 | 119 | ```yaml 120 | Type: String[] 121 | Parameter Sets: input 122 | Aliases: 123 | 124 | Required: False 125 | Position: Named 126 | Default value: None 127 | Accept pipeline input: True (ByValue) 128 | Accept wildcard characters: False 129 | ``` 130 | 131 | ### -Moniker 132 | 133 | Specify the winget moniker. 134 | 135 | ```yaml 136 | Type: String 137 | Parameter Sets: moniker 138 | Aliases: 139 | 140 | Required: False 141 | Position: Named 142 | Default value: None 143 | Accept pipeline input: False 144 | Accept wildcard characters: False 145 | ``` 146 | 147 | ### -Name 148 | 149 | Specify the winget package name. 150 | 151 | ```yaml 152 | Type: String 153 | Parameter Sets: name 154 | Aliases: 155 | 156 | Required: False 157 | Position: 0 158 | Default value: None 159 | Accept pipeline input: True (ByPropertyName) 160 | Accept wildcard characters: False 161 | ``` 162 | 163 | ### -Source 164 | 165 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 166 | 167 | ```yaml 168 | Type: String 169 | Parameter Sets: (All) 170 | Aliases: 171 | 172 | Required: False 173 | Position: Named 174 | Default value: winget 175 | Accept pipeline input: False 176 | Accept wildcard characters: False 177 | ``` 178 | 179 | ### CommonParameters 180 | 181 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 182 | 183 | ## INPUTS 184 | 185 | ### System.String[] 186 | 187 | ## OUTPUTS 188 | 189 | ### WGPackage 190 | 191 | ## NOTES 192 | 193 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 194 | 195 | ## RELATED LINKS 196 | 197 | [Get-WGInstalled](Get-WGInstalled.md) 198 | -------------------------------------------------------------------------------- /docs/Get-WGPath.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3QRKW5t 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGPath 9 | 10 | ## SYNOPSIS 11 | 12 | Get the Winget executable path. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGPath [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Normally, you will run winget under your user context. But if you are running winget under the System context, that account won't be able to locate winget.exe. This command will return the full path to the winget.exe file depending on the user context. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGPath 30 | C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\Winget.exe 31 | ``` 32 | 33 | ## PARAMETERS 34 | 35 | ### CommonParameters 36 | 37 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 38 | 39 | ## INPUTS 40 | 41 | ### None 42 | 43 | ## OUTPUTS 44 | 45 | ### System.String 46 | 47 | ## NOTES 48 | 49 | ## RELATED LINKS 50 | -------------------------------------------------------------------------------- /docs/Get-WGReleaseNote.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3nauPEz 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGReleaseNote 9 | 10 | ## SYNOPSIS 11 | 12 | Get the latest release note for winget. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Get-WGReleaseNote [-AsMarkdown] [-Online] [-Preview] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | This command will query the Github repository for the winget project and display the release note for the latest version. You can also display it in markdown format or go to the online version. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Get-WGReleaseNote 30 | 31 | Name : Windows Package Manager v1.1.12653 32 | Version : v1.1.12653 33 | Published : 9/27/2021 6:08:01 PM 34 | Prerelease : False 35 | Notes : This release represents our Windows Package Manager 1.release 36 | candidate build for Windows 10 (1809+). 37 | 38 | Experimental features have been disabled in this release. We will 39 | follow this release with another Pre-release "developer" 40 | build at GitHub so users can continue with experimental features 41 | available. 42 | 43 | # Bugs 44 | #797 Silent install of "winget install git.git" is not working 45 | #1497 Make rename retry more frequently for longer, then try 46 | making a hardlink 47 | Link : https://github.com/microsoft/winget-cli/releases/tag/v1.1.12653 48 | ``` 49 | 50 | The default output. 51 | 52 | ### Example 2 53 | 54 | ```powershell 55 | PS C:\> Get-WGReleaseNote -asmarkdown | Show-Markdown 56 | ``` 57 | 58 | If running in PowerShell 7, you can use the markdown cmdlets. 59 | 60 | ### Example 3 61 | 62 | ```powershell 63 | PS C:\> Get-WGReleaseNote | Select-Object Name,Version,Published 64 | 65 | Name Version Published 66 | ---- ------- --------- 67 | Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM 68 | ``` 69 | 70 | The output is an object. 71 | 72 | ### Example 4 73 | 74 | ```powershell 75 | PS C:\> Get-WGReleaseNote -Preview 76 | 77 | 78 | Name : Windows Package Manager v1.1.12701 79 | Version : v1.1.12701 80 | Published : 9/28/2021 10:30:01 AM 81 | Prerelease : True 82 | Notes : This release is the first development build after the Windows 83 | Package Manager 1.1 release candidate build for Windows 10 84 | (1809+). 85 | 86 | Experimental features have been enabled in this release. This 87 | build will be released to Windows Insider Dev builds, and 88 | Windows Package Manager Insiders. 89 | ``` 90 | 91 | Get the release note for the latest preview. 92 | 93 | ## PARAMETERS 94 | 95 | ### -AsMarkdown 96 | 97 | Create a markdown document. 98 | 99 | ```yaml 100 | Type: SwitchParameter 101 | Parameter Sets: (All) 102 | Aliases: md 103 | 104 | Required: False 105 | Position: Named 106 | Default value: None 107 | Accept pipeline input: False 108 | Accept wildcard characters: False 109 | ``` 110 | 111 | ### -Online 112 | 113 | Open the release note location online using your default web browser. 114 | 115 | ```yaml 116 | Type: SwitchParameter 117 | Parameter Sets: (All) 118 | Aliases: 119 | 120 | Required: False 121 | Position: Named 122 | Default value: None 123 | Accept pipeline input: False 124 | Accept wildcard characters: False 125 | ``` 126 | 127 | ### -Preview 128 | 129 | Get latest preview release. 130 | 131 | ```yaml 132 | Type: SwitchParameter 133 | Parameter Sets: (All) 134 | Aliases: 135 | 136 | Required: False 137 | Position: Named 138 | Default value: None 139 | Accept pipeline input: False 140 | Accept wildcard characters: False 141 | ``` 142 | 143 | ### CommonParameters 144 | 145 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 146 | 147 | ## INPUTS 148 | 149 | ### None 150 | 151 | ## OUTPUTS 152 | 153 | ### System.String 154 | 155 | ### WGReleaseNote 156 | 157 | ## NOTES 158 | 159 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 160 | 161 | ## RELATED LINKS 162 | 163 | [Install-WinGet](Install-WinGet.md) 164 | 165 | [Test-WGVersion](Test-WGVersion.md) 166 | -------------------------------------------------------------------------------- /docs/Get-WGUpgrade.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3fVkHKQ 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-WGUpgrade 9 | 10 | ## SYNOPSIS 11 | 12 | Get available winget upgrades. 13 | 14 | ## SYNTAX 15 | 16 | ### Name (Default) 17 | 18 | ```yaml 19 | Get-WGUpgrade [-Name ] [] 20 | ``` 21 | 22 | ### ID 23 | 24 | ```yaml 25 | Get-WGUpgrade [-ID ] [] 26 | ``` 27 | 28 | ## DESCRIPTION 29 | 30 | Use this command to get information about available winget upgrades. You can then manually decide what to upgrade using winget or pipe to Invoke-WingetUpgrade. The output will not show any packages where the installed version cannot be determined. 31 | 32 | ## EXAMPLES 33 | 34 | ### Example 1 35 | 36 | ```powershell 37 | PS C:\> Get-WGUpgrade 38 | 39 | Name ID Installed Available 40 | ---- -- --------- --------- 41 | Discord Discord.Discord 1.0.9005 1.0.9006 42 | Visual Studio Community 2019 Microsoft.VisualStudio.2019.Community 16.11.18 16.11.19 43 | Spotify Spotify.Spotify 1.1.91.824.g07f1e963 1.1.93.896.g3ae3b4f3 44 | VSCodium VSCodium.VSCodium 1.71.1.22256 1.71.2.22258 45 | Camtasia TechSmith.Camtasia 22.0.4.39133 22.1.1.39848 46 | Windows Software Development Kit Microsoft.WindowsSDK 10.0.22000.832 10.0.22621.1 47 | Microsoft SQL Server Management Studio Microsoft.SQLServerManagementStudio 18.12 18.12.1 48 | PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 49 | ESET Endpoint Security ESET.EndpointSecurity 9.0.2046.0 9.1.2057.0 50 | ``` 51 | 52 | Get all available updates. 53 | 54 | ### Example 2 55 | 56 | ```powershell 57 | PS C:\> get-wgupgrade p* 58 | 59 | Name ID Installed Available 60 | ---- -- --------- --------- 61 | PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 62 | ``` 63 | 64 | Get upgrades with a name that begins with P. 65 | 66 | ### Example 3 67 | 68 | ```powershell 69 | PS C:\> Get-WGUpgrade -id micro* | Select-Object Name,Version,Available 70 | 71 | Name Version Available 72 | ---- ------- --------- 73 | Visual Studio Community 2019 16.11.18 16.11.19 74 | Windows Software Development Kit 10.0.22000.832 10.0.22621.1 75 | Microsoft SQL Server Management Studio 18.12 18.12.1 76 | PowerToys (Preview) 0.62.0 0.62.1 77 | ``` 78 | 79 | Get upgrades by ID that starts with "micro". Note that the actual object property name, "Version", differs from the formatted column header of "Installed." 80 | 81 | ## PARAMETERS 82 | 83 | ### -ID 84 | 85 | Specify a package by ID. Wildcards are permitted. 86 | 87 | ```yaml 88 | Type: String 89 | Parameter Sets: ID 90 | Aliases: 91 | 92 | Required: False 93 | Position: Named 94 | Default value: None 95 | Accept pipeline input: False 96 | Accept wildcard characters: False 97 | ``` 98 | 99 | ### -Name 100 | 101 | Specify a package by name. Wildcards are permitted. 102 | 103 | ```yaml 104 | Type: String 105 | Parameter Sets: Name 106 | Aliases: 107 | 108 | Required: False 109 | Position: Named 110 | Default value: None 111 | Accept pipeline input: False 112 | Accept wildcard characters: False 113 | ``` 114 | 115 | ### CommonParameters 116 | 117 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 118 | 119 | ## INPUTS 120 | 121 | ### None 122 | 123 | ## OUTPUTS 124 | 125 | ### wgUpgrade 126 | 127 | ## NOTES 128 | 129 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 130 | 131 | ## RELATED LINKS 132 | 133 | [Invoke-WGUpgrade](Invoke-WGUpgrade.md) 134 | 135 | [Get-WGInstalled](Get-WGInstalled.md) 136 | -------------------------------------------------------------------------------- /docs/Install-WinGet.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/2WYteX6 5 | schema: 2.0.0 6 | --- 7 | 8 | # Install-WinGet 9 | 10 | ## SYNOPSIS 11 | 12 | Install the latest winget release from Github. 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Install-WinGet [-Preview] [-Passthru] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Until 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 package requires the Microsoft.VCLibs.140.00.UWPDesktop package. If it isn't found, it will be downloaded and installed. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Install-Winget 30 | ``` 31 | 32 | ## PARAMETERS 33 | 34 | ### -Confirm 35 | 36 | Prompts you for confirmation before running the cmdlet. 37 | 38 | ```yaml 39 | Type: SwitchParameter 40 | Parameter Sets: (All) 41 | Aliases: cf 42 | 43 | Required: False 44 | Position: Named 45 | Default value: False 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -Passthru 51 | 52 | Display the AppxPackage after installation. 53 | 54 | ```yaml 55 | Type: SwitchParameter 56 | Parameter Sets: (All) 57 | Aliases: 58 | 59 | Required: False 60 | Position: Named 61 | Default value: False 62 | Accept pipeline input: False 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### -WhatIf 67 | 68 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 69 | 70 | ```yaml 71 | Type: SwitchParameter 72 | Parameter Sets: (All) 73 | Aliases: wi 74 | 75 | Required: False 76 | Position: Named 77 | Default value: False 78 | Accept pipeline input: False 79 | Accept wildcard characters: False 80 | ``` 81 | 82 | ### -Preview 83 | 84 | Install the latest preview build. 85 | 86 | ```yaml 87 | Type: SwitchParameter 88 | Parameter Sets: (All) 89 | Aliases: 90 | 91 | Required: False 92 | Position: Named 93 | Default value: None 94 | Accept pipeline input: False 95 | Accept wildcard characters: False 96 | ``` 97 | 98 | ### CommonParameters 99 | 100 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 101 | 102 | ## INPUTS 103 | 104 | ### None 105 | 106 | ## OUTPUTS 107 | 108 | ### None 109 | 110 | ### AppxPackage 111 | 112 | ## NOTES 113 | 114 | Learn more about PowerShell: 115 | http://jdhitsolutions.com/blog/essential-powershell-resources/ 116 | 117 | ## RELATED LINKS 118 | 119 | [Get-WGReleaseNote](Get-WGReleaseNote.md) 120 | -------------------------------------------------------------------------------- /docs/Invoke-WGUpgrade.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3FVQsOn 5 | schema: 2.0.0 6 | --- 7 | 8 | # Invoke-WGUpgrade 9 | 10 | ## SYNOPSIS 11 | 12 | Invoke a Winget upgrade on all available upgrades. 13 | 14 | ## SYNTAX 15 | 16 | ### id (Default) 17 | 18 | ```yaml 19 | Invoke-WGUpgrade -ID [-WhatIf] [-Confirm] [] 20 | ``` 21 | 22 | ### input 23 | 24 | ```yaml 25 | Invoke-WGUpgrade [-InputObject ] [-WhatIf] [-Confirm] [] 26 | ``` 27 | 28 | ### all 29 | 30 | ```yaml 31 | Invoke-WGUpgrade [-All] [-IncludeUnknown] [-WhatIf] [-Confirm] [] 32 | ``` 33 | 34 | ## DESCRIPTION 35 | 36 | This command is designed to make it easy to upgrade winget packages. The command will skip packages with unknown versions. The installation process accepts all licenses and agreements, and uses the silent winget option. 37 | 38 | Be aware that winget may still encounter a problem attempting to invoke the update. 39 | 40 | ## EXAMPLES 41 | 42 | ### Example 1 43 | 44 | ```powershell 45 | PS C:\> Invoke-WGUpgrade -id Microsoft.VC++2015-2019Redist-x64 46 | 47 | Found Microsoft Visual C++ 2015-2019 Redistributable (x64) [Microsoft.VC++2015-2019Redist-x64] Version 14.29.30135.0 48 | This application is licensed to you by its owner. 49 | Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. 50 | Downloading https://download.visualstudio.microsoft.com/download/pr/d3cbdace-2bb8-4dc5-a326-2c1c0f1ad5ae/9B9DD72C27AB1DB081DE56BB7B73BEE9A00F60D14ED8E6FDE45DAB3E619B5F04/VC_redist.x64.exe 51 | Successfully verified installer hash 52 | Starting package install... 53 | Successfully installed 54 | ``` 55 | 56 | ### Example 2 57 | 58 | ```powershell 59 | PS C:\> Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf 60 | What if: Performing the operation "Upgrade from 3.2.0+06857 to 3.3.1+06924" on target "PrivateInternetAccess.PrivateInternetAccess". 61 | What if: Performing the operation "Upgrade from 0.58.0 to 0.61.1" on target "Microsoft.PowerToys". 62 | What if: Performing the operation "Upgrade from 3.10.3 to 3.10.6" on target "Python.Python.3". 63 | ``` 64 | 65 | You can pipe output from Get-WGUpgrade to this command. 66 | 67 | ### Example 3 68 | 69 | ```powershell 70 | PS C:\> Get-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade 71 | ``` 72 | 73 | Pipe the list of available upgrades to Out-Gridview where you can select items. Invoke-WGUpgrade will then install the selected upgrades. 74 | 75 | ### Example 4 76 | 77 | ```powershell 78 | PS C:\> Invoke-WGUpgrade -all 79 | ``` 80 | 81 | This is the equivalent of running winget upgrade --all. 82 | 83 | ## PARAMETERS 84 | 85 | ### -Confirm 86 | 87 | Prompts you for confirmation before running the cmdlet. 88 | 89 | ```yaml 90 | Type: SwitchParameter 91 | Parameter Sets: (All) 92 | Aliases: cf 93 | 94 | Required: False 95 | Position: Named 96 | Default value: None 97 | Accept pipeline input: False 98 | Accept wildcard characters: False 99 | ``` 100 | 101 | ### -WhatIf 102 | 103 | Shows what would happen if the cmdlet runs. 104 | The cmdlet is not run. 105 | 106 | ```yaml 107 | Type: SwitchParameter 108 | Parameter Sets: (All) 109 | Aliases: wi 110 | 111 | Required: False 112 | Position: Named 113 | Default value: None 114 | Accept pipeline input: False 115 | Accept wildcard characters: False 116 | ``` 117 | 118 | ### -ID 119 | 120 | Specify a package by ID. Wildcards are permitted. 121 | 122 | ```yaml 123 | Type: String 124 | Parameter Sets: id 125 | Aliases: 126 | 127 | Required: True 128 | Position: Named 129 | Default value: None 130 | Accept pipeline input: False 131 | Accept wildcard characters: False 132 | ``` 133 | 134 | ### -InputObject 135 | 136 | Specify a wgUpgrade object. 137 | 138 | ```yaml 139 | Type: Object 140 | Parameter Sets: input 141 | Aliases: 142 | 143 | Required: False 144 | Position: Named 145 | Default value: None 146 | Accept pipeline input: True (ByValue) 147 | Accept wildcard characters: False 148 | ``` 149 | 150 | ### -All 151 | 152 | Update all packages. 153 | 154 | ```yaml 155 | Type: SwitchParameter 156 | Parameter Sets: all 157 | Aliases: 158 | 159 | Required: False 160 | Position: Named 161 | Default value: None 162 | Accept pipeline input: False 163 | Accept wildcard characters: False 164 | ``` 165 | 166 | ### -IncludeUnknown 167 | 168 | Upgrade packages even if their current version cannot be determined. This requires the -All parameter. 169 | 170 | ```yaml 171 | Type: SwitchParameter 172 | Parameter Sets: all 173 | Aliases: 174 | 175 | Required: False 176 | Position: Named 177 | Default value: None 178 | Accept pipeline input: False 179 | Accept wildcard characters: False 180 | ``` 181 | 182 | ### CommonParameters 183 | 184 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 185 | 186 | ## INPUTS 187 | 188 | ### None 189 | 190 | ## OUTPUTS 191 | 192 | ### None 193 | 194 | ## NOTES 195 | 196 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 197 | 198 | ## RELATED LINKS 199 | 200 | [Get-WGUpgrade](Get-WGUpgrade.md) 201 | 202 | [Get-WGInstalled](Get-WGInstalled.md) 203 | -------------------------------------------------------------------------------- /docs/Test-WGVersion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: WingetTools-help.xml 3 | Module Name: WingetTools 4 | online version: https://bit.ly/3GYwrbj 5 | schema: 2.0.0 6 | --- 7 | 8 | # Test-WGVersion 9 | 10 | ## SYNOPSIS 11 | 12 | Test Winget version 13 | 14 | ## SYNTAX 15 | 16 | ```yaml 17 | Test-WGVersion [-Quiet] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | 22 | Test-WGVersion is a simple command you use to discover if you need to update winget. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | 28 | ```powershell 29 | PS C:\> Test-WGVersion 30 | 31 | Installed Online Update Command 32 | --------- ------ ------ ------- 33 | 1.1.13405 1.1.12653 False C:\Users\Jeff\AppData\Local\Microsoft\Windo… 34 | ``` 35 | 36 | The default output is an object showing the currently installed version and the latest stable version online. If an update is available, and you are running in the PowerShell console or VS Code, the Update value will be displayed in Green. 37 | 38 | ### Example 2 39 | 40 | ```powershell 41 | PS C:\> Test-WGVersion -Quiet 42 | False 43 | ``` 44 | 45 | Run the test and get a simple, Boolean result indicating if an update is available. 46 | 47 | ## PARAMETERS 48 | 49 | ### -Quiet 50 | 51 | Get a Boolean result indicating if an update is available. 52 | 53 | ```yaml 54 | Type: SwitchParameter 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: False 59 | Position: Named 60 | Default value: None 61 | Accept pipeline input: True (ByValue) 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### CommonParameters 66 | 67 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 68 | 69 | ## INPUTS 70 | 71 | ### System.Management.Automation.SwitchParameter 72 | 73 | ## OUTPUTS 74 | 75 | ### Boolean 76 | 77 | ### WGVersion 78 | 79 | ## NOTES 80 | 81 | ## RELATED LINKS 82 | 83 | [Get-WGReleaseNote](Get-WGReleaseNote.md) 84 | -------------------------------------------------------------------------------- /docs/about_WingetTools.md: -------------------------------------------------------------------------------- 1 | # WingetTools 2 | 3 | ## about_WingetTools 4 | 5 | # SHORT DESCRIPTION 6 | 7 | The Wingettools module is a PowerShell wrapper around the winget command-line tool. 8 | 9 | # LONG DESCRIPTION 10 | 11 | The winget command-line tool is Microsoft's latest package manager and installer. It 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. 12 | 13 | ## Install-WinGet 14 | 15 | Until 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 package requires the 16 | DesktopAppInstaller package. If it isn't found, it will be downloaded and installed. 17 | 18 | ## Get-WGReleaseNote 19 | 20 | This command will query the Github repository for the winget project and display the release note for the latest version. You can also display it in markdown format or go to the online version. 21 | 22 | ## Get-WGPackage 23 | 24 | This command is a PowerShell wrapper aroung winget.cmd that will get a package and create an object you can use in PowerShell. The object has a default table view but the object has other properties. 25 | 26 | Name : GitHub CLI 27 | ID : GitHub.cli 28 | Version : 2.0.0 29 | Publisher : GitHub, Inc. 30 | Author : GitHub, Inc. 31 | Moniker : gh 32 | Description : GitHubs official command-line tool. 33 | Homepage : https://github.com/cli/cli 34 | License : MIT License 35 | License Url : https://github.com/cli/cli/blob/HEAD/LICENSE 36 | Type : Msi 37 | Locale : en-US 38 | Download Url : https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_windows_amd64.msi 39 | SHA256 : 09761ebfcf1a294b79cf5c820d2a51edca9d5e515cbd1036c45862c462b36189 40 | 41 | If you want to get details on multiple packages, pipe a winget search command to this PowerShell command. 42 | 43 | winget search --tag github --source winget | Get-WGPackage 44 | 45 | ## Get-WGInstalled 46 | 47 | This command will get a list of all packages installed with winget. These will be packages with winget as the source. 48 | 49 | ## Get-WGUpgrade 50 | 51 | This command makes it easier to get PowerShell objects that reflect upgrade packages. The command writes a custom object to the pipeline which is formatted as a table by default. You can use this command to pipe to winget.exe in a ForEach loop to upgrade, or pipe to Invoke-WGUpgrade which supports -WhatIf. 52 | 53 | ## Invoke-WGUpgrade 54 | 55 | This command is a wrapper around the winget upgrade option. The upgrade is done using the package ID and silent install options. The upgrade also accepts all licenses and agreements. 56 | 57 | # TROUBLESHOOTING NOTE 58 | 59 | If there are problems with commands in this module, try running the winget command directly. Report problems to the module's Github repository at https://github.com/jdhitsolutions/WingetTools/issues. 60 | 61 | # SEE ALSO 62 | 63 | Visit the winget Github repository for more information about the project at https://github.com/microsoft/winget-cli. 64 | 65 | # KEYWORDS 66 | 67 | - winget 68 | - packages 69 | -------------------------------------------------------------------------------- /en-US/WingetTools-help.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Get-WGInstalled 6 | Get 7 | WGInstalled 8 | 9 | Get packages installed with winget. 10 | 11 | 12 | 13 | This command will get a list of all packages installed with winget. These will be packages with winget as the source. This command will have to be revised once more sources are available. 14 | 15 | 16 | 17 | Get-WGInstalled 18 | 19 | Source 20 | 21 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 22 | 23 | String 24 | 25 | String 26 | 27 | 28 | winget 29 | 30 | 31 | 32 | 33 | 34 | Source 35 | 36 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 37 | 38 | String 39 | 40 | String 41 | 42 | 43 | winget 44 | 45 | 46 | 47 | 48 | 49 | None 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | wgPackage 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/learn 69 | 70 | 71 | 72 | 73 | -------------------------- Example 1 -------------------------- 74 | PS C:\> Get-WGInstalled -outvariable in 75 | 76 | Name ID Version Description 77 | ---- -- ------- ----------- 78 | Visual Studio Community Microsoft.VisualStudio.20 16.11.10 The Community edition of Visual Studio, an 79 | 2019 19.Community integrated development environment (IDE) from 80 | Microsoft. Individual developers have no 81 | restrictions on their use of the Community 82 | edition. 83 | Audacity Audacity.Audacity 3.1.3 Audacity is a free, easy-to-use, multi-track 84 | audio editor and recorder for Windows, macOS, 85 | GNU/Linux and other operating systems. 86 | Ubuntu Canonical.Ubuntu 2004.2021.825.0 Ubuntu on Windows allows you to use Ubuntu 87 | Terminal and run Ubuntu command line 88 | utilities including bash, ssh, git, apt and 89 | many more. This is the latest LTS release. 90 | CCleaner Piriform.CCleaner 6.00 CCleaner is a utility used to clean 91 | potentially unwanted files and invalid 92 | Windows Registry entries from a computer. 93 | ... 94 | 95 | Because of the processing overhead, it is recommended that you save results to a variable. 96 | 97 | 98 | 99 | -------------------------- Example 2 -------------------------- 100 | PS C\> $in | format-table -view update 101 | 102 | ID InstalledVersion OnlineVersion Update 103 | -- ---------------- ------------- ------ 104 | Microsoft.VisualStudio.2019.Community 16.11.10 16.11.17 True 105 | Audacity.Audacity 3.1.3 3.1.3 False 106 | Piriform.CCleaner 6.00 6.01 True 107 | Canonical.Ubuntu 2004.2021.825.0 2004.2021.825.0 False 108 | Discord.Discord 1.0.9003 1.0.9005 True 109 | Foxit.FoxitReader 12.0.0.12394 12.0.1.12430 True 110 | Git.Git 2.37.1 2.37.1 False 111 | 112 | There is a named table view you can use to quickly identify potential updates. 113 | 114 | 115 | 116 | 117 | 118 | Online Version: 119 | https://bit.ly/38Ps9nb 120 | 121 | 122 | Get-WGPackage 123 | 124 | 125 | 126 | Get-WGUpgrade 127 | 128 | 129 | 130 | 131 | 132 | 133 | Get-WGPackage 134 | Get 135 | WGPackage 136 | 137 | Get information about a winget package 138 | 139 | 140 | 141 | This command is a PowerShell wrapper around winget.cmd that will get a package and create an object you can use in PowerShell. 142 | 143 | 144 | 145 | Get-WGPackage 146 | 147 | ID 148 | 149 | Specify the package ID. 150 | 151 | String 152 | 153 | String 154 | 155 | 156 | None 157 | 158 | 159 | Source 160 | 161 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 162 | 163 | String 164 | 165 | String 166 | 167 | 168 | winget 169 | 170 | 171 | 172 | Get-WGPackage 173 | 174 | InputObject 175 | 176 | Pipe a winget search to this function. 177 | 178 | String[] 179 | 180 | String[] 181 | 182 | 183 | None 184 | 185 | 186 | Source 187 | 188 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 189 | 190 | String 191 | 192 | String 193 | 194 | 195 | winget 196 | 197 | 198 | 199 | Get-WGPackage 200 | 201 | Moniker 202 | 203 | Specify the winget moniker. 204 | 205 | String 206 | 207 | String 208 | 209 | 210 | None 211 | 212 | 213 | Source 214 | 215 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 216 | 217 | String 218 | 219 | String 220 | 221 | 222 | winget 223 | 224 | 225 | 226 | Get-WGPackage 227 | 228 | Name 229 | 230 | Specify the winget package name. 231 | 232 | String 233 | 234 | String 235 | 236 | 237 | None 238 | 239 | 240 | Source 241 | 242 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 243 | 244 | String 245 | 246 | String 247 | 248 | 249 | winget 250 | 251 | 252 | 253 | 254 | 255 | ID 256 | 257 | Specify the package ID. 258 | 259 | String 260 | 261 | String 262 | 263 | 264 | None 265 | 266 | 267 | InputObject 268 | 269 | Pipe a winget search to this function. 270 | 271 | String[] 272 | 273 | String[] 274 | 275 | 276 | None 277 | 278 | 279 | Moniker 280 | 281 | Specify the winget moniker. 282 | 283 | String 284 | 285 | String 286 | 287 | 288 | None 289 | 290 | 291 | Name 292 | 293 | Specify the winget package name. 294 | 295 | String 296 | 297 | String 298 | 299 | 300 | None 301 | 302 | 303 | Source 304 | 305 | Specify a winget source. Currently, there is really only a single source but this might eventually change. 306 | 307 | String 308 | 309 | String 310 | 311 | 312 | winget 313 | 314 | 315 | 316 | 317 | 318 | System.String[] 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | WGPackage 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 338 | 339 | 340 | 341 | 342 | -------------------------- Example 1 -------------------------- 343 | PS C:\> Get-WGPackage -name "Foxit PDF Reader" 344 | 345 | Name ID Version Description 346 | ---- -- ------- ----------- 347 | Foxit PDF Reader Foxit.FoxitReader 12.0.1.12430 Foxit is a powerful PDF reader for viewing, filling out forms and more. 348 | 349 | Get a package by its name. 350 | 351 | 352 | 353 | -------------------------- Example 2 -------------------------- 354 | PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object * 355 | 356 | Moniker : pwsh-preview 357 | Description : PowerShell is a cross-platform Windows, Linux, and macOS 358 | automation and configuration tool/frame work that works 359 | well with your existing tools and is optimized for 360 | dealing with structured data e.g. JSON, CSV, XML, etc., 361 | REST APIs, and object models. 362 | Author : Microsoft Corporation 363 | Publisher : Microsoft Corporation 364 | PublisherUrl : https://github.com/PowerShell/PowerShell 365 | PublisherSupportUrl : https://github.com/PowerShell/PowerShell/issues 366 | Homepage : https://microsoft.com/PowerShell 367 | Name : PowerShell Preview 368 | ID : Microsoft.PowerShell.Preview 369 | Version : 7.3.7.0 370 | Source : winget 371 | Computername : WIN11DESK 372 | 373 | The output is a rich object. 374 | 375 | 376 | 377 | -------------------------- Example 3 -------------------------- 378 | PS C:\> winget search --tag powerbi | Get-WGPackage | Select-Object Name,ID,Version 379 | 380 | 381 | Name ID Version 382 | ---- -- ------- 383 | Microsoft PowerBI Desktop Microsoft.PowerBI 2.109.642.0 384 | DAX Studio DaxStudio.DaxStudio 3.0.0.725 385 | 386 | You can pipe the results of a winget search command to this function. 387 | 388 | 389 | 390 | 391 | 392 | Online Version: 393 | https://bit.ly/3jQh9MH 394 | 395 | 396 | Get-WGInstalled 397 | 398 | 399 | 400 | 401 | 402 | 403 | Get-WGPath 404 | Get 405 | WGPath 406 | 407 | Get the Winget executable path. 408 | 409 | 410 | 411 | Normally, you will run winget under your user context. But if you are running winget under the System context, that account won't be able to locate winget.exe. This command will return the full path to the winget.exe file depending on the user context. 412 | 413 | 414 | 415 | Get-WGPath 416 | 417 | 418 | 419 | 420 | 421 | 422 | None 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | System.String 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | -------------------------- Example 1 -------------------------- 447 | PS C:\> Get-WGPath 448 | C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\Winget.exe 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | Online Version: 457 | https://bit.ly/3QRKW5t 458 | 459 | 460 | 461 | 462 | 463 | Get-WGReleaseNote 464 | Get 465 | WGReleaseNote 466 | 467 | Get the latest release note for winget. 468 | 469 | 470 | 471 | This command will query the Github repository for the winget project and display the release note for the latest version. You can also display it in markdown format or go to the online version. 472 | 473 | 474 | 475 | Get-WGReleaseNote 476 | 477 | AsMarkdown 478 | 479 | Create a markdown document. 480 | 481 | 482 | SwitchParameter 483 | 484 | 485 | False 486 | 487 | 488 | Online 489 | 490 | Open the release note location online using your default web browser. 491 | 492 | 493 | SwitchParameter 494 | 495 | 496 | False 497 | 498 | 499 | Preview 500 | 501 | Get latest preview release. 502 | 503 | 504 | SwitchParameter 505 | 506 | 507 | False 508 | 509 | 510 | 511 | 512 | 513 | AsMarkdown 514 | 515 | Create a markdown document. 516 | 517 | SwitchParameter 518 | 519 | SwitchParameter 520 | 521 | 522 | False 523 | 524 | 525 | Online 526 | 527 | Open the release note location online using your default web browser. 528 | 529 | SwitchParameter 530 | 531 | SwitchParameter 532 | 533 | 534 | False 535 | 536 | 537 | Preview 538 | 539 | Get latest preview release. 540 | 541 | SwitchParameter 542 | 543 | SwitchParameter 544 | 545 | 546 | False 547 | 548 | 549 | 550 | 551 | 552 | None 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | System.String 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | WGReleaseNote 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 580 | 581 | 582 | 583 | 584 | -------------------------- Example 1 -------------------------- 585 | PS C:\> Get-WGReleaseNote 586 | 587 | Name : Windows Package Manager v1.1.12653 588 | Version : v1.1.12653 589 | Published : 9/27/2021 6:08:01 PM 590 | Prerelease : False 591 | Notes : This release represents our Windows Package Manager 1.release 592 | candidate build for Windows 10 (1809+). 593 | 594 | Experimental features have been disabled in this release. We will 595 | follow this release with another Pre-release "developer" 596 | build at GitHub so users can continue with experimental features 597 | available. 598 | 599 | # Bugs 600 | #797 Silent install of "winget install git.git" is not working 601 | #1497 Make rename retry more frequently for longer, then try 602 | making a hardlink 603 | Link : https://github.com/microsoft/winget-cli/releases/tag/v1.1.12653 604 | 605 | The default output. 606 | 607 | 608 | 609 | -------------------------- Example 2 -------------------------- 610 | PS C:\> Get-WGReleaseNote -asmarkdown | Show-Markdown 611 | 612 | If running in PowerShell 7, you can use the markdown cmdlets. 613 | 614 | 615 | 616 | -------------------------- Example 3 -------------------------- 617 | PS C:\> Get-WGReleaseNote | Select-Object Name,Version,Published 618 | 619 | Name Version Published 620 | ---- ------- --------- 621 | Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM 622 | 623 | The output is an object. 624 | 625 | 626 | 627 | -------------------------- Example 4 -------------------------- 628 | PS C:\> Get-WGReleaseNote -Preview 629 | 630 | 631 | Name : Windows Package Manager v1.1.12701 632 | Version : v1.1.12701 633 | Published : 9/28/2021 10:30:01 AM 634 | Prerelease : True 635 | Notes : This release is the first development build after the Windows 636 | Package Manager 1.1 release candidate build for Windows 10 637 | (1809+). 638 | 639 | Experimental features have been enabled in this release. This 640 | build will be released to Windows Insider Dev builds, and 641 | Windows Package Manager Insiders. 642 | 643 | Get the release note for the latest preview. 644 | 645 | 646 | 647 | 648 | 649 | Online Version: 650 | https://bit.ly/3nauPEz 651 | 652 | 653 | Install-WinGet 654 | 655 | 656 | 657 | Test-WGVersion 658 | 659 | 660 | 661 | 662 | 663 | 664 | Get-WGUpgrade 665 | Get 666 | WGUpgrade 667 | 668 | Get available winget upgrades. 669 | 670 | 671 | 672 | Use this command to get information about available winget upgrades. You can then manually decide what to upgrade using winget or pipe to Invoke-WingetUpgrade. The output will not show any packages where the installed version cannot be determined. 673 | 674 | 675 | 676 | Get-WGUpgrade 677 | 678 | ID 679 | 680 | Specify a package by ID. Wildcards are permitted. 681 | 682 | String 683 | 684 | String 685 | 686 | 687 | None 688 | 689 | 690 | 691 | Get-WGUpgrade 692 | 693 | Name 694 | 695 | Specify a package by name. Wildcards are permitted. 696 | 697 | String 698 | 699 | String 700 | 701 | 702 | None 703 | 704 | 705 | 706 | 707 | 708 | ID 709 | 710 | Specify a package by ID. Wildcards are permitted. 711 | 712 | String 713 | 714 | String 715 | 716 | 717 | None 718 | 719 | 720 | Name 721 | 722 | Specify a package by name. Wildcards are permitted. 723 | 724 | String 725 | 726 | String 727 | 728 | 729 | None 730 | 731 | 732 | 733 | 734 | 735 | None 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | wgUpgrade 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 755 | 756 | 757 | 758 | 759 | -------------------------- Example 1 -------------------------- 760 | PS C:\> Get-WGUpgrade 761 | 762 | Name ID Installed Available 763 | ---- -- --------- --------- 764 | Discord Discord.Discord 1.0.9005 1.0.9006 765 | Visual Studio Community 2019 Microsoft.VisualStudio.2019.Community 16.11.18 16.11.19 766 | Spotify Spotify.Spotify 1.1.91.824.g07f1e963 1.1.93.896.g3ae3b4f3 767 | VSCodium VSCodium.VSCodium 1.71.1.22256 1.71.2.22258 768 | Camtasia TechSmith.Camtasia 22.0.4.39133 22.1.1.39848 769 | Windows Software Development Kit Microsoft.WindowsSDK 10.0.22000.832 10.0.22621.1 770 | Microsoft SQL Server Management Studio Microsoft.SQLServerManagementStudio 18.12 18.12.1 771 | PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 772 | ESET Endpoint Security ESET.EndpointSecurity 9.0.2046.0 9.1.2057.0 773 | 774 | Get all available updates. 775 | 776 | 777 | 778 | -------------------------- Example 2 -------------------------- 779 | PS C:\> get-wgupgrade p* 780 | 781 | Name ID Installed Available 782 | ---- -- --------- --------- 783 | PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 784 | 785 | Get upgrades with a name that begins with P. 786 | 787 | 788 | 789 | -------------------------- Example 3 -------------------------- 790 | PS C:\> Get-WGUpgrade -id micro* | Select-Object Name,Version,Available 791 | 792 | Name Version Available 793 | ---- ------- --------- 794 | Visual Studio Community 2019 16.11.18 16.11.19 795 | Windows Software Development Kit 10.0.22000.832 10.0.22621.1 796 | Microsoft SQL Server Management Studio 18.12 18.12.1 797 | PowerToys (Preview) 0.62.0 0.62.1 798 | 799 | Get upgrades by ID that starts with "micro". Note that the actual object property name, "Version", differs from the formatted column header of "Installed." 800 | 801 | 802 | 803 | 804 | 805 | Online Version: 806 | https://bit.ly/3fVkHKQ 807 | 808 | 809 | Invoke-WGUpgrade 810 | 811 | 812 | 813 | Get-WGInstalled 814 | 815 | 816 | 817 | 818 | 819 | 820 | Install-WinGet 821 | Install 822 | WinGet 823 | 824 | Install the latest winget release from Github. 825 | 826 | 827 | 828 | Until 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 package requires the Microsoft.VCLibs.140.00.UWPDesktop package. If it isn't found, it will be downloaded and installed. 829 | 830 | 831 | 832 | Install-WinGet 833 | 834 | Confirm 835 | 836 | Prompts you for confirmation before running the cmdlet. 837 | 838 | 839 | SwitchParameter 840 | 841 | 842 | False 843 | 844 | 845 | Passthru 846 | 847 | Display the AppxPackage after installation. 848 | 849 | 850 | SwitchParameter 851 | 852 | 853 | False 854 | 855 | 856 | WhatIf 857 | 858 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 859 | 860 | 861 | SwitchParameter 862 | 863 | 864 | False 865 | 866 | 867 | Preview 868 | 869 | Install the latest preview build. 870 | 871 | 872 | SwitchParameter 873 | 874 | 875 | False 876 | 877 | 878 | 879 | 880 | 881 | Confirm 882 | 883 | Prompts you for confirmation before running the cmdlet. 884 | 885 | SwitchParameter 886 | 887 | SwitchParameter 888 | 889 | 890 | False 891 | 892 | 893 | Passthru 894 | 895 | Display the AppxPackage after installation. 896 | 897 | SwitchParameter 898 | 899 | SwitchParameter 900 | 901 | 902 | False 903 | 904 | 905 | WhatIf 906 | 907 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 908 | 909 | SwitchParameter 910 | 911 | SwitchParameter 912 | 913 | 914 | False 915 | 916 | 917 | Preview 918 | 919 | Install the latest preview build. 920 | 921 | SwitchParameter 922 | 923 | SwitchParameter 924 | 925 | 926 | False 927 | 928 | 929 | 930 | 931 | 932 | None 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | None 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | AppxPackage 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 960 | 961 | 962 | 963 | 964 | -------------------------- Example 1 -------------------------- 965 | PS C:\> Install-Winget 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | Online Version: 974 | https://bit.ly/2WYteX6 975 | 976 | 977 | Get-WGReleaseNote 978 | 979 | 980 | 981 | 982 | 983 | 984 | Invoke-WGUpgrade 985 | Invoke 986 | WGUpgrade 987 | 988 | Invoke a Winget upgrade on all available upgrades. 989 | 990 | 991 | 992 | This command is designed to make it easy to upgrade winget packages. The command will skip packages with unknown versions. The installation process accepts all licenses and agreements, and uses the silent winget option. 993 | Be aware that winget may still encounter a problem attempting to invoke the update. 994 | 995 | 996 | 997 | Invoke-WGUpgrade 998 | 999 | Confirm 1000 | 1001 | Prompts you for confirmation before running the cmdlet. 1002 | 1003 | 1004 | SwitchParameter 1005 | 1006 | 1007 | False 1008 | 1009 | 1010 | WhatIf 1011 | 1012 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 1013 | 1014 | 1015 | SwitchParameter 1016 | 1017 | 1018 | False 1019 | 1020 | 1021 | ID 1022 | 1023 | Specify a package by ID. Wildcards are permitted. 1024 | 1025 | String 1026 | 1027 | String 1028 | 1029 | 1030 | None 1031 | 1032 | 1033 | 1034 | Invoke-WGUpgrade 1035 | 1036 | Confirm 1037 | 1038 | Prompts you for confirmation before running the cmdlet. 1039 | 1040 | 1041 | SwitchParameter 1042 | 1043 | 1044 | False 1045 | 1046 | 1047 | WhatIf 1048 | 1049 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 1050 | 1051 | 1052 | SwitchParameter 1053 | 1054 | 1055 | False 1056 | 1057 | 1058 | InputObject 1059 | 1060 | Specify a wgUpgrade object. 1061 | 1062 | Object 1063 | 1064 | Object 1065 | 1066 | 1067 | None 1068 | 1069 | 1070 | 1071 | Invoke-WGUpgrade 1072 | 1073 | Confirm 1074 | 1075 | Prompts you for confirmation before running the cmdlet. 1076 | 1077 | 1078 | SwitchParameter 1079 | 1080 | 1081 | False 1082 | 1083 | 1084 | WhatIf 1085 | 1086 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 1087 | 1088 | 1089 | SwitchParameter 1090 | 1091 | 1092 | False 1093 | 1094 | 1095 | All 1096 | 1097 | Update all packages. 1098 | 1099 | 1100 | SwitchParameter 1101 | 1102 | 1103 | False 1104 | 1105 | 1106 | IncludeUnknown 1107 | 1108 | Upgrade packages even if their current version cannot be determined. This requires the -All parameter. 1109 | 1110 | 1111 | SwitchParameter 1112 | 1113 | 1114 | False 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | Confirm 1121 | 1122 | Prompts you for confirmation before running the cmdlet. 1123 | 1124 | SwitchParameter 1125 | 1126 | SwitchParameter 1127 | 1128 | 1129 | False 1130 | 1131 | 1132 | WhatIf 1133 | 1134 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 1135 | 1136 | SwitchParameter 1137 | 1138 | SwitchParameter 1139 | 1140 | 1141 | False 1142 | 1143 | 1144 | ID 1145 | 1146 | Specify a package by ID. Wildcards are permitted. 1147 | 1148 | String 1149 | 1150 | String 1151 | 1152 | 1153 | None 1154 | 1155 | 1156 | InputObject 1157 | 1158 | Specify a wgUpgrade object. 1159 | 1160 | Object 1161 | 1162 | Object 1163 | 1164 | 1165 | None 1166 | 1167 | 1168 | All 1169 | 1170 | Update all packages. 1171 | 1172 | SwitchParameter 1173 | 1174 | SwitchParameter 1175 | 1176 | 1177 | False 1178 | 1179 | 1180 | IncludeUnknown 1181 | 1182 | Upgrade packages even if their current version cannot be determined. This requires the -All parameter. 1183 | 1184 | SwitchParameter 1185 | 1186 | SwitchParameter 1187 | 1188 | 1189 | False 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | None 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | None 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ 1215 | 1216 | 1217 | 1218 | 1219 | -------------------------- Example 1 -------------------------- 1220 | PS C:\> Invoke-WGUpgrade -id Microsoft.VC++2015-2019Redist-x64 1221 | 1222 | Found Microsoft Visual C++ 2015-2019 Redistributable (x64) [Microsoft.VC++2015-2019Redist-x64] Version 14.29.30135.0 1223 | This application is licensed to you by its owner. 1224 | Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. 1225 | Downloading https://download.visualstudio.microsoft.com/download/pr/d3cbdace-2bb8-4dc5-a326-2c1c0f1ad5ae/9B9DD72C27AB1DB081DE56BB7B73BEE9A00F60D14ED8E6FDE45DAB3E619B5F04/VC_redist.x64.exe 1226 | Successfully verified installer hash 1227 | Starting package install... 1228 | Successfully installed 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | -------------------------- Example 2 -------------------------- 1235 | PS C:\> Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf 1236 | What if: Performing the operation "Upgrade from 3.2.0+06857 to 3.3.1+06924" on target "PrivateInternetAccess.PrivateInternetAccess". 1237 | What if: Performing the operation "Upgrade from 0.58.0 to 0.61.1" on target "Microsoft.PowerToys". 1238 | What if: Performing the operation "Upgrade from 3.10.3 to 3.10.6" on target "Python.Python.3". 1239 | 1240 | You can pipe output from Get-WGUpgrade to this command. 1241 | 1242 | 1243 | 1244 | -------------------------- Example 3 -------------------------- 1245 | PS C:\> Get-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade 1246 | 1247 | Pipe the list of available upgrades to Out-Gridview where you can select items. Invoke-WGUpgrade will then install the selected upgrades. 1248 | 1249 | 1250 | 1251 | -------------------------- Example 4 -------------------------- 1252 | PS C:\> Invoke-WGUpgrade -all 1253 | 1254 | This is the equivalent of running winget upgrade --all. 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | Online Version: 1261 | https://bit.ly/3FVQsOn 1262 | 1263 | 1264 | Get-WGUpgrade 1265 | 1266 | 1267 | 1268 | Get-WGInstalled 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | Test-WGVersion 1276 | Test 1277 | WGVersion 1278 | 1279 | Test Winget version 1280 | 1281 | 1282 | 1283 | Test-WGVersion is a simple command you use to discover if you need to update winget. 1284 | 1285 | 1286 | 1287 | Test-WGVersion 1288 | 1289 | Quiet 1290 | 1291 | Get a Boolean result indicating if an update is available. 1292 | 1293 | 1294 | SwitchParameter 1295 | 1296 | 1297 | False 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | Quiet 1304 | 1305 | Get a Boolean result indicating if an update is available. 1306 | 1307 | SwitchParameter 1308 | 1309 | SwitchParameter 1310 | 1311 | 1312 | False 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | System.Management.Automation.SwitchParameter 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | Boolean 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | WGVersion 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | -------------------------- Example 1 -------------------------- 1351 | PS C:\> Test-WGVersion 1352 | 1353 | Installed Online Update Command 1354 | --------- ------ ------ ------- 1355 | 1.1.13405 1.1.12653 False C:\Users\Jeff\AppData\Local\Microsoft\Windo… 1356 | 1357 | The default output is an object showing the currently installed version and the latest stable version online. If an update is available, and you are running in the PowerShell console or VS Code, the Update value will be displayed in Green. 1358 | 1359 | 1360 | 1361 | -------------------------- Example 2 -------------------------- 1362 | PS C:\> Test-WGVersion -Quiet 1363 | False 1364 | 1365 | Run the test and get a simple, Boolean result indicating if an update is available. 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | Online Version: 1372 | https://bit.ly/3GYwrbj 1373 | 1374 | 1375 | Get-WGReleaseNote 1376 | 1377 | 1378 | 1379 | 1380 | -------------------------------------------------------------------------------- /en-US/about_WingetTools.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_wingettools 3 | 4 | SHORT DESCRIPTION 5 | The Wingettools module is a PowerShell wrapper around the winget 6 | command-line tool. 7 | 8 | LONG DESCRIPTION 9 | The winget command-line tool is Microsoft's latest package manager and 10 | installer. It is a command-line tool, not a PowerShell command. The commands 11 | in the WingetTools module are designed to make using winget a little more 12 | PowerShell friendly. 13 | 14 | Install-WinGet 15 | Until winget is publically available in the Microsoft Store, you can 16 | download and install the latest version from Github. This command must be 17 | run in a Windows PowerShell session in Windows 10 or Windows 11. The package 18 | requires the DesktopAppInstaller package. If it isn't found, it will be 19 | downloaded and installed. 20 | 21 | Get-WGReleaseNote 22 | This command will query the Github repository for the winget project and 23 | display the release note for the latest version. You can also display it in 24 | markdown format or go to the online version. 25 | 26 | Get-WGPackage 27 | This command is a PowerShell wrapper aroung winget.cmd that will get a 28 | package and create an object you can use in PowerShell. The object has a 29 | default table view but the object has other properties. 30 | 31 | Name : GitHub CLI 32 | ID : GitHub.cli 33 | Version : 2.0.0 34 | Publisher : GitHub, Inc. 35 | Author : GitHub, Inc. 36 | Moniker : gh 37 | Description : GitHubs official command-line tool. 38 | Homepage : https://github.com/cli/cli 39 | License : MIT License 40 | License Url : https://github.com/cli/cli/blob/HEAD/LICENSE 41 | Type : Msi 42 | Locale : en-US 43 | Download Url : https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_windows_amd64.msi 44 | SHA256 : 09761ebfcf1a294b79cf5c820d2a51edca9d5e515cbd1036c45862c462b.. 45 | 46 | If you want to get details on multiple packages, pipe a winget search 47 | command to this PowerShell command. 48 | 49 | winget search --tag github --source winget | Get-WGPackage 50 | 51 | Get-WGInstalled 52 | This command will get a list of all packages installed with winget. These 53 | will be packages with winget as the source. 54 | 55 | Get-WGUpgrade 56 | This command makes it easier to get PowerShell objects that reflect upgrade 57 | packages. The command writes a custom object to the pipeline which is 58 | formatted as a table by default. You can use this command to pipe to 59 | winget.exe in a ForEach loop to upgrade, or pipe to Invoke-WGUpgrade which 60 | supports -WhatIf. 61 | 62 | Invoke-WGUpgrade 63 | This command is a wrapper around the winget upgrade option. The upgrade is 64 | done using the package ID and silent install options. The upgrade also 65 | accepts all licenses and agreements. 66 | 67 | TROUBLESHOOTING NOTE 68 | If there are problems with commands in this module, try running the winget 69 | command directly. Report problems to the module's Github repository at 70 | https://github.com/jdhitsolutions/WingetTools/issues. 71 | 72 | SEE ALSO 73 | Visit the winget Github repository for more information about the project at 74 | https://github.com/microsoft/winget-cli. 75 | 76 | KEYWORDS 77 | - winget 78 | - packages 79 | -------------------------------------------------------------------------------- /en-US/localized.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Found = "Found" 3 | Name = "Name" 4 | ID = "ID" 5 | Version = "Version" 6 | Publisher = "Publisher" 7 | PublisherUrl = "Publisher Url" 8 | PublisherSupportUrl = "Publisher Support Url" 9 | Author = "Author" 10 | Moniker = "Moniker" 11 | Description = "Description" 12 | Homepage = "Homepage" 13 | License = "License" 14 | LicenseURL = "License URL" 15 | Source = "Source" 16 | Computername = "Computername" 17 | } -------------------------------------------------------------------------------- /formats/wginstalled.format.ps1xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | default 14 | 15 | WGInstalled 16 | 17 | 18 | 20 | 21 | 22 | 23 | 25 24 | left 25 | 26 | 27 | 28 | 25 29 | left 30 | 31 | 32 | 33 | 19 34 | left 35 | 36 | 37 | 38 | 132 39 | left 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | Name 52 | 53 | 54 | ID 55 | 56 | 57 | InstalledVersion 58 | 59 | 60 | Description 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | update 71 | 72 | WGInstalled 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 20 81 | left 82 | 83 | 84 | 85 | 19 86 | left 87 | 88 | 89 | 90 | 16 91 | left 92 | 93 | 94 | 95 | 9 96 | left 97 | 98 | 99 | 100 | 101 | 102 | 103 | 107 | 108 | ID 109 | 110 | 111 | InstalledVersion 112 | 113 | 114 | OnlineVersion 115 | 116 | 117 | Update 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /formats/wgpackage.format.ps1xml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 8 | 9 | default 10 | 11 | WGPackage 12 | 13 | 14 | 16 | 17 | 18 | 19 | 30 20 | left 21 | 22 | 23 | 24 | 30 25 | left 26 | 27 | 28 | 29 | 20 30 | left 31 | 32 | 33 | 34 | 35 | left 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | Name 48 | 49 | 50 | ID 51 | 52 | 53 | Version 54 | 55 | 56 | Description 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | default 66 | 67 | wgPackage 68 | 69 | 70 | 71 | 72 | 73 | 77 | 78 | 79 | Name 80 | 81 | 82 | 83 | ID 84 | 85 | 86 | 87 | Moniker 88 | 89 | 90 | 91 | Description 92 | 93 | 94 | 95 | Version 96 | 97 | 98 | 99 | Author 100 | 101 | 102 | 103 | Publisher 104 | 105 | 106 | 107 | PublisherUrl 108 | 109 | 110 | 111 | Homepage 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /formats/wgversion.format.ps1xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | default 14 | 15 | WGVersion 16 | 17 | 18 | 20 | 21 | 22 | 23 | 12 24 | left 25 | 26 | 27 | 28 | 12 29 | left 30 | 31 | 32 | 33 | 9 34 | left 35 | 36 | 37 | 38 | 63 39 | left 40 | 41 | 42 | 43 | 44 | 45 | 49 | 50 | Installed 51 | 52 | 53 | Online 54 | 55 | 56 | 57 | if ($host.name -match "console|vscode" -AND ($_.Update)) { 58 | 59 | "$([char]27)[92m$($_.Update)$([char]27)[0m" 60 | } 61 | else { 62 | $_.Update 63 | } 64 | 65 | 66 | 67 | Command 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /formats/wingetupgrade.format.ps1xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | default 14 | 15 | wgUpgrade 16 | 17 | 18 | 20 | 21 | 22 | 23 | 25 24 | left 25 | 26 | 27 | 28 | 45 29 | left 30 | 31 | 32 | 33 | 15 34 | left 35 | 36 | 37 | 38 | 15 39 | left 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | Name 52 | 53 | 54 | ID 55 | 56 | 57 | Version 58 | 59 | 60 | Available 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /fr-FR/localized.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | Found = "Trouvé" 3 | Name = "Nom" 4 | ID = "ID" 5 | Version = "Variante" 6 | Publisher = "Editeur" 7 | PublisherUrl = "PublisherUrl" 8 | PublisherSupportUrl = "PublisherSupportUrl" 9 | Author = "Auteur" 10 | Moniker = "Surnom" 11 | Description = "Description" 12 | Homepage = "Page d'accueil" 13 | License = "Licence" 14 | LicenseURL = "LicenseURL" 15 | Source = "Origine" 16 | Computername = "NomOrdinateur" 17 | } -------------------------------------------------------------------------------- /functions/Get-WGInstalled.ps1: -------------------------------------------------------------------------------- 1 | Function Get-WGInstalled { 2 | [cmdletbinding()] 3 | [OutputType("WGInstalled")] 4 | Param( 5 | [Parameter(Position = 0, HelpMessage = "Specify a winget source")] 6 | [ValidateNotNullOrEmpty()] 7 | [string]$Source = "winget" 8 | ) 9 | 10 | Begin { 11 | Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)" 12 | $tmpFile = "$env:temp\wgExport_{0}.json" -f (Get-Date -Format yyyymmdd) 13 | $Winget = Get-WGPath 14 | } #begin 15 | 16 | Process { 17 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Building list of packages with a winget source" 18 | [void](& $winget export -s winget -o $tmpFile --include-versions) 19 | if (Test-Path -Path $tmpFile) { 20 | #import the json file 21 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Importing temporary JSON data" 22 | 23 | $json = Get-Content -Path $tmpFile | ConvertFrom-Json 24 | #get the packages 25 | $count = $json.Sources.packages.count 26 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Found $count packages. Getting details." 27 | 28 | $jobList = [system.collections.generic.list[object]]::new() 29 | $wingetPath = $winget 30 | foreach ($pkg in $json.Sources.packages) { 31 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] $($pkg.PackageIdentifier)" 32 | $i++ 33 | #9 August 2022 Using Threadjobs to get online package details for better scaling - JDH 34 | $sb = { 35 | Param([object]$pkg, [string]$source, [string]$wingetPath) 36 | Function _parseVersion { 37 | #parse out odd characters from version strings 38 | [cmdletbinding()] 39 | Param([string]$VersionString) 40 | 41 | if ($versionString -match "unknown") { 42 | $out = $null 43 | } 44 | elseif ($VersionString -match "[\<\>]") { 45 | $out = ($VersionString -replace $matches.values, "").Trim() 46 | } 47 | else { 48 | $out = $VersionString.Trim() 49 | } 50 | $out 51 | } 52 | 53 | try { 54 | $show = & $wingetPath show --id $pkg.PackageIdentifier --source $source 55 | $pkg | Add-Member -MemberType NoteProperty -Name show -Value $show -PassThru -Force 56 | } #Try 57 | catch { 58 | #$show | Out-String | Write-Host -fore red 59 | Write-Warning "There was an unknown problem with $($pkg.PackageIdentifier)" 60 | } 61 | } 62 | 63 | $joblist.add($(Start-ThreadJob -ScriptBlock $sb -ArgumentList $pkg, $source, $wingetPath -Name wg)) 64 | 65 | } #foreach pkg 66 | 67 | #process jobs 68 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Getting thread job results" 69 | Do { 70 | $joblist.FindAll({ $args[0].state -eq 'Completed' }) | 71 | ForEach-Object { 72 | #convert the job output to a defined object 73 | $jobresult = $_ | Receive-Job 74 | $show = $jobresult.show | Where-Object { $_ -notmatch "(\d+%|\d MB|\s+)$" -and $_.length -gt 0 } 75 | $show | Out-String | Write-Debug 76 | Try { 77 | $yml = $show.replace(" - ", " ") | Select-Object -Skip 1 | Where-Object { $_ -match "^(\s+)?(\b(\w+)\b).*:" } | ConvertFrom-Yaml -ErrorAction stop 78 | } 79 | Catch { 80 | Write-Warning "Failed to convert to YAML" 81 | $show | Out-String | Write-Warning 82 | } 83 | [regex]$rxname = "(?(?<=\w\s).*)(?=\s\[(?[\S\.]+)\])" 84 | $id = $jobresult.PackageIdentifier 85 | #$rxname.match($show[0]).groups["id"].value 86 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Getting installed version for $id" 87 | # 8/16/2022 Need to account for multiple versions JDH 88 | $installed = _parseVersion $jobresult.version 89 | #($json.sources.packages.where({$_.packageIdentifier -eq $id}).version) 90 | $online = _parseVersion (($show | Select-String "$($localized.version):") -split "$($localized.version): ")[1].trim() 91 | $out = [wginstalled]::new() 92 | 93 | $out.Name = $rxname.match($show[0]).groups["name"].value 94 | $out.ID = $id 95 | $out.InstalledVersion = $installed 96 | $out.Version = $online 97 | $out.Publisher = $yml.$($localized.Publisher) 98 | $out.PublisherUrl = $yml.$($localized.PublisherURL) 99 | $out.PublisherSupportUrl = $yml.$($localized.PublisherSupportUrl) 100 | $out.Author = $yml.$($localized.Author) 101 | $out.Moniker = $yml.$($localized.Moniker) 102 | $out.Description = $yml.$($localized.Description) 103 | $out.Homepage = $yml.$($Localized.homepage) 104 | $out.Source = $Source 105 | $out 106 | 107 | 108 | [void]$joblist.remove($_) 109 | } 110 | } Until ($jobList.count -eq 0) 111 | } 112 | else { 113 | Write-Warning "There was a problem getting a list of installed packages." 114 | } 115 | } #process 116 | 117 | End { 118 | if (Test-Path -Path $tmpFile) { 119 | #always remove the temp file 120 | Remove-Item $tmpFile -WhatIf:$false 121 | } 122 | if (Get-Job -Name wg) { 123 | #always remove the threadjob 124 | Remove-Job -Name wg -Force -WhatIf:$false 125 | } 126 | Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)" 127 | 128 | } #end 129 | 130 | } #close Get-WGInstalled 131 | 132 | Update-TypeData -TypeName WGInstalled -MemberType ScriptProperty -MemberName Update -Value { 133 | <# 134 | compare versions first at [version] type, then as a simple string comparison 135 | to determine if there is an upgrade available. 136 | #> 137 | $a = $null 138 | $z = $null 139 | if (([version]::tryparse($this.onlineversion, [ref]$a)) -AND ([version]::tryparse($this.installedversion, [ref]$z))) { 140 | $a -gt $z 141 | } 142 | elseif ($null -eq $this.InstalledVersion) { 143 | $False 144 | } 145 | else { 146 | $this.installedversion -ne $This.onlineversion 147 | } 148 | 149 | } -Force 150 | 151 | -------------------------------------------------------------------------------- /functions/Get-WGPackage.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | As was made evident by Issue #1, Winget output is not always in English, and 3 | not every property is returned from the Winget show command. I think the best 4 | course of action is to turn the raw winget data into a list object and then 5 | use the Find() method to find specific values like Version,Description, and Moniker. 6 | 7 | However there is still an issue of what to do with non-English results. 8 | #> 9 | Function Get-WGPackage { 10 | [cmdletbinding(DefaultParameterSetName = "name")] 11 | [OutputType("WGPackage")] 12 | Param( 13 | [Parameter( 14 | ParameterSetName = "name", 15 | Position = 0, 16 | Mandatory, 17 | ValueFromPipelineByPropertyName, 18 | HelpMessage = "Specify the package name" 19 | )] 20 | [ValidateNotNullOrEmpty()] 21 | [string]$Name, 22 | [Parameter( 23 | ParameterSetName = "id", 24 | ValueFromPipelineByPropertyName, 25 | HelpMessage = "Specify the package ID" 26 | )] 27 | [ValidateNotNullOrEmpty()] 28 | [string]$ID, 29 | [Parameter( 30 | ParameterSetName = "moniker", 31 | HelpMessage = "Specify the moniker" 32 | )] 33 | [ValidateNotNullOrEmpty()] 34 | [string]$Moniker, 35 | [Parameter( 36 | ParameterSetname = "input", 37 | ValueFromPipeline, 38 | HelpMessage = "Pipe a winget search to this function" 39 | )] 40 | [object[]]$InputObject, 41 | 42 | [Parameter(HelpMessage = "Specify a winget source")] 43 | [ValidateNotNullOrEmpty()] 44 | [string]$Source = "winget" 45 | 46 | ) 47 | Begin { 48 | Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)" 49 | #some regex patterns 50 | [regex]$rxIDAll = "(?<=\s)[\w-+]{3,}\.[\w-+]{3,}(\.[\w-+]{3,})?" 51 | 52 | Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Using source $source" 53 | $winget = Get-WGPath 54 | #9/20/2022 If winget path has a space enclose in quotes. Issue #11 -JDH 55 | if ($winget -match "\s") { 56 | $winget = "&'$winget'" 57 | } 58 | $cmdText = "$winget show --source $source" 59 | 60 | Switch ($PSCmdlet.ParameterSetName) { 61 | "Name" { 62 | if ($name) { 63 | $cmdText += " --name '$name'" 64 | } 65 | } 66 | "ID" { 67 | $cmdText += " --id $id" 68 | } 69 | "Moniker" { 70 | $cmdText += " --moniker $moniker" 71 | } 72 | } 73 | 74 | #create a scriptblock 75 | $sb = [scriptblock]::create($cmdText) 76 | 77 | } #begin 78 | Process { 79 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Using Parameter set $($PSCmdlet.ParameterSetName)" 80 | 81 | if ($InputObject) { 82 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Processing winget output by input" 83 | $data = $InputObject | Where-Object { $rxIDAll.IsMatch($InputObject) } | 84 | ForEach-Object { 85 | $id = $rxIDAll.Match($_).Value 86 | if ($id -match "\w+") { 87 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Show $id" 88 | &$winget show --id $id --source $source | Where-Object {$_ -notmatch "(\d+%|\d MB|\s+)$" -and $_.length -gt 0} 89 | } 90 | else { 91 | write-Warning $_ 92 | } 93 | } 94 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Processed $($data.count) item(s)" 95 | } 96 | else { 97 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Invoking: $cmdtext" 98 | $data = Invoke-Command -ScriptBlock $sb | Where-Object {$_ -notmatch "(\d+%|\d MB|\s+)$" -and $_.length -gt 0} 99 | } 100 | 101 | if ($data -match "Multiple apps found") { 102 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Multiple packages found" 103 | #Get all the IDS 104 | $IDs = $rxIDAll.Matches($data).value 105 | 106 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Processing $($IDS.count) packages" 107 | $out = foreach ($item in $ids) { 108 | #get the exact package to avoid problems when there are duplicate names 109 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Retrieving $item" 110 | _convert (&$winget show -e $item | Where-Object {$_ -notmatch "(\d+%|\d MB|\s+)$" -and $_.length -gt 0}) 111 | } 112 | } #if multiple found 113 | elseif ($data -match "no package found") { 114 | if ($cmdText) { 115 | Write-Warning $cmdText 116 | } 117 | elseif ($InputObject) { 118 | Write-Warning ($InputObject | Out-String) 119 | } 120 | Write-Warning ($data | Out-String).Trim() 121 | } 122 | elseif ($data) { 123 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Converting winget data" 124 | $data | Out-String | Write-Verbose 125 | $out = _convert $data 126 | } #else 127 | 128 | #insert the typename 129 | $out 130 | 131 | } #process 132 | End { 133 | Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)" 134 | } #end 135 | 136 | } -------------------------------------------------------------------------------- /functions/Get-WGReleaseNote.ps1: -------------------------------------------------------------------------------- 1 | Function Get-WGReleaseNote { 2 | [CmdletBinding()] 3 | [alias("wglatest")] 4 | [outputtype([System.String])] 5 | [outputtype("WGReleaseNote")] 6 | Param( 7 | [Parameter(HelpMessage = "Create a markdown document.")] 8 | [alias("md")] 9 | [switch]$AsMarkdown, 10 | [switch]$Online, 11 | [Parameter(HelpMessage = "Get latest preview release")] 12 | [switch]$Preview 13 | ) 14 | 15 | Write-Verbose "[$((Get-Date).TimeofDay)] Starting $($myinvocation.mycommand)" 16 | 17 | $uri = "https://api.github.com/repos/microsoft/winget-cli/releases" 18 | 19 | Try { 20 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting information from $uri" 21 | $get = Invoke-RestMethod -Uri $uri -Method Get -ErrorAction stop 22 | 23 | if ($Preview) { 24 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest preview release" 25 | $data = $get | Where-Object { $_.PreRelease } | Select-Object -First 1 26 | } 27 | else { 28 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest stable release" 29 | $data = $get | Where-Object { -not $_.PreRelease } | Select-Object -First 1 30 | } 31 | 32 | $data | Select-Object -Property Name, tag_name, published_at, prerelease, 33 | 34 | @{Name = "bodyLength"; Expression = { $_.body.length } } | Out-String | Write-Verbose 35 | 36 | if ($online) { 37 | Write-Verbose "[$((Get-Date).TimeofDay)] Opening $($data.html_url) in your web browser." 38 | Start-Process $data.html_url 39 | } 40 | elseif ($AsMarkdown) { 41 | Write-Verbose "[$((Get-Date).TimeofDay)] Creating a markdown document" 42 | $md = @" 43 | # $($data.name) 44 | 45 | > Version : $($data.tag_name) 46 | > 47 | > Published : $($data.published_at -as [datetime]) 48 | > 49 | > Pre-Release : $($data.prerelease) 50 | 51 | $($data.body.trim()) 52 | 53 | *** 54 | 55 | *Source: $($data.html_url)* 56 | "@ 57 | #write the object to the pipeline 58 | $md 59 | } #as markdown 60 | else { 61 | Write-Verbose "[$((Get-Date).TimeofDay)] Creating ReleaseNote" 62 | 63 | [pscustomobject]@{ 64 | PSTypename = "WGReleaseNote" 65 | Name = $data.name 66 | Version = $data.tag_name 67 | Published = $($data.published_at -as [datetime]) 68 | Prerelease = If ($data.prerelease -eq 'true') { $True } else { $false } 69 | Notes = $data.body.trim() 70 | Link = $data.html_url 71 | } 72 | } 73 | } #try 74 | Catch { 75 | Throw $_ 76 | } 77 | Write-Verbose "[$((Get-Date).TimeofDay)] Ending $($myinvocation.mycommand)" 78 | } #end function -------------------------------------------------------------------------------- /functions/Get-WingetPath.ps1: -------------------------------------------------------------------------------- 1 | Function Get-WGPath { 2 | [cmdletbinding()] 3 | [OutputType("String")] 4 | Param() 5 | Write-Verbose "[$((Get-Date).TimeofDay)] Starting $($myinvocation.mycommand)" 6 | $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value # get account running function 7 | Write-Verbose "[$((Get-Date).TimeofDay)] Running as $currentUser" 8 | # S-1-5-18 is SYSTEM account for Windows 9 | if ($currentUser -eq "S-1-5-18") { 10 | Write-Verbose "[$((Get-Date).TimeofDay)] Running in SYSTEM context. Set path to WINGET executable" 11 | $winget = Get-ChildItem -Path "$env:ProgramFiles\WindowsApps" -Recurse -File | Where-Object { $_.name -like "AppInstallerCLI.exe" -or $_.name -like "WinGet.exe" } | Select-Object -ExpandProperty fullname 12 | # If there are multiple versions, select latest 13 | if ($winget.count -gt 1) { 14 | $winget = $winget[-1] 15 | } 16 | } 17 | else { 18 | Write-Verbose "[$((Get-Date).TimeofDay)] Using user default location" 19 | # 9/20/2022 use source path from Get-0Command 20 | $winget = (Get-Command winget.exe).source 21 | #"$env:localappdata\Microsoft\WindowsApps\Winget.exe" 22 | } 23 | $winget 24 | Write-Verbose "[$((Get-Date).TimeofDay)] Ending $($myinvocation.mycommand)" 25 | } 26 | -------------------------------------------------------------------------------- /functions/Get-WingetUpgrade.ps1: -------------------------------------------------------------------------------- 1 | Function Get-WGUpgrade { 2 | [cmdletbinding(DefaultParameterSetName="name")] 3 | [outputType("wgUpgrade")] 4 | Param( 5 | [Parameter(Position = 0, HelpMessage = "Specify a package by name. Wildcards are permitted.",ParameterSetName = "Name")] 6 | [ValidateNotNullOrEmpty()] 7 | [string]$Name, 8 | 9 | [Parameter(HelpMessage = "Specify a package by ID. Wildcards are permitted.",ParameterSetName = "ID")] 10 | [ValidateNotNullOrEmpty()] 11 | [string]$ID 12 | ) 13 | 14 | Write-Verbose "Starting $($MyInvocation.MyCommand)" 15 | #get installed packaged with an available update and that have an InstalledVersion value 16 | 17 | if ($Name) { 18 | Write-Verbose "Filtering by name: $name" 19 | $list = Get-WGInstalled | Where-Object {($_.Update) -AND ($_.name -like $name )-And ($_.InstalledVersion)} 20 | } 21 | elseif ($ID) { 22 | Write-Verbose "Filtering by id: $id" 23 | $list = Get-WGInstalled | Where-Object {($_.Update) -AND ($_.id -like $ID) -And ($_.InstalledVersion)} 24 | } 25 | else { 26 | Write-Verbose "Returning all upgrades" 27 | $list = Get-WGInstalled | Where-Object {$_.Update -And ($_.InstalledVersion)} 28 | } 29 | 30 | Write-Verbose "Found $($list.count) matching packages" 31 | foreach ($item in $list) { 32 | $pkg = [wgUpgrade]::new( $item.name, $item.id,$item.InstalledVersion,$item.OnlineVersion) 33 | $pkg.source =$item.source 34 | $pkg 35 | } 36 | Write-Verbose "Ending $($MyInvocation.MyCommand)" 37 | } 38 | 39 | -------------------------------------------------------------------------------- /functions/Install-Winget.ps1: -------------------------------------------------------------------------------- 1 | #this command will work in PowerShell 7.2 and later 2 | Function Install-WinGet { 3 | #Install the latest package from GitHub 4 | [cmdletbinding(SupportsShouldProcess)] 5 | [alias("iwg")] 6 | [OutputType("None")] 7 | [OutputType("Microsoft.Windows.Appx.PackageManager.Commands.AppxPackage")] 8 | Param( 9 | [Parameter(HelpMessage = "Install the latest preview build.")] 10 | [switch]$Preview, 11 | [Parameter(HelpMessage = "Display the AppxPackage after installation.")] 12 | [switch]$Passthru 13 | ) 14 | 15 | Write-Verbose "[$((Get-Date).TimeofDay)] Starting $($myinvocation.mycommand)" 16 | 17 | if ($Iscoreclr -AND ($PSVersionTable.PSVersion -le 7.2)) { 18 | Write-Warning "If running this command in PowerShell 7, you need at least version 7.2." 19 | return 20 | } 21 | 22 | #test for requirement 23 | $Requirement = Get-AppPackage Microsoft.VCLibs.140.00.UWPDesktop 24 | 25 | if (-Not $requirement) { 26 | Write-Verbose "Installing Desktop App requirement" 27 | Try { 28 | $vclib = Join-Path -Path $env:temp -ChildPath "Microsoft.VCLibs.x64.14.00.Desktop.appx" 29 | Invoke-WebRequest -Uri "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" -UseBasicParsing -OutFile $vclib -ErrorAction stop 30 | if (Test-Path $vclib) { 31 | Add-AppxPackage -Path $vclib -ErrorAction Stop 32 | } 33 | else { 34 | Throw "Failed to find $vclib" 35 | } 36 | } 37 | Catch { 38 | Throw $_ 39 | } 40 | } 41 | 42 | $uri = "https://api.github.com/repos/microsoft/winget-cli/releases" 43 | 44 | Try { 45 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting information from $uri" 46 | $get = Invoke-RestMethod -Uri $uri -Method Get -ErrorAction stop 47 | if ($preview) { 48 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest preview release" 49 | $data = ($get | where-object {$_.Prerelease} | Select-Object -first 1).Assets | Where-Object name -Match 'msixbundle' 50 | } 51 | else { 52 | Write-Verbose "[$((Get-Date).TimeofDay)] Getting latest stable release" 53 | $data = ($get | where-object {-Not $_.Prerelease} | Select-Object -first 1).Assets | Where-Object name -Match 'msixbundle' 54 | 55 | } 56 | #$data = $get | Select-Object -first 1 57 | 58 | $appx = $data.browser_download_url 59 | #$data.assets[0].browser_download_url 60 | Write-Verbose "[$((Get-Date).TimeofDay)] $appx" 61 | If ($pscmdlet.ShouldProcess($appx, "Downloading asset")) { 62 | $file = Join-Path -Path $env:temp -ChildPath $data.name 63 | 64 | Write-Verbose "[$((Get-Date).TimeofDay)] Saving to $file" 65 | Invoke-WebRequest -Uri $appx -UseBasicParsing -DisableKeepAlive -OutFile $file 66 | 67 | Write-Verbose "[$((Get-Date).TimeofDay)] Adding Appx Package" 68 | Add-AppxPackage -Path $file -ErrorAction Stop 69 | 70 | if ($passthru) { 71 | Get-AppxPackage microsoft.desktopAppInstaller 72 | } 73 | } 74 | } #Try 75 | Catch { 76 | Write-Verbose "[$((Get-Date).TimeofDay)] There was an error." 77 | Throw $_ 78 | } 79 | Write-Verbose "[$((Get-Date).TimeofDay)] Ending $($myinvocation.mycommand)" 80 | } -------------------------------------------------------------------------------- /functions/Invoke-WingetUpgrade.ps1: -------------------------------------------------------------------------------- 1 | Function Invoke-WGUpgrade { 2 | [cmdletbinding(SupportsShouldProcess, DefaultParameterSetName = "id")] 3 | [OutputType("None")] 4 | Param( 5 | [Parameter( 6 | Position = 0, 7 | ValueFromPipeline, 8 | HelpMessage = "Specify a wingetUpgrade object", 9 | ParameterSetName = "input" 10 | )] 11 | [ValidateNotNullOrEmpty()] 12 | [object]$InputObject, 13 | 14 | [Parameter( 15 | Mandatory, 16 | HelpMessage = "Specify a package by ID. Wildcards are permitted.", 17 | ParameterSetName = "id" 18 | )] 19 | [ValidateNotNullOrEmpty()] 20 | [string]$ID, 21 | 22 | [Parameter(HelpMessage = "Update all packages.", ParameterSetName = "all")] 23 | [switch]$All, 24 | 25 | [Parameter(HelpMessage = "Upgrade packages even if their current version cannot be determined. This requires -all", ParameterSetName = "all")] 26 | [switch]$IncludeUnknown 27 | ) 28 | 29 | Begin { 30 | Write-Verbose "Starting $($MyInvocation.MyCommand)" 31 | $winget = Get-WGPath 32 | } #begin 33 | Process { 34 | #set a flag indicating items were process in this script block 35 | $processed = $True 36 | Write-Verbose "Detected parameter set $($pscmdlet.ParameterSetName)" 37 | if ($pscmdlet.ParameterSetName -eq 'id') { 38 | $inputobject = Get-WGUpgrade -ID $ID 39 | } 40 | 41 | if ($inputobject -AND $($pscmdlet.ParameterSetName -match "id|input")) { 42 | Write-Verbose "Processing input" 43 | foreach ($item in $InputObject) { 44 | if ($pscmdlet.ShouldProcess($item.id, "Upgrade from $($item.version) to $($item.Available)")) { 45 | if ($item.source) { 46 | & $winget upgrade --id $item.id --source $item.source --silent --accept-package-agreements --accept-source-agreements 47 | } 48 | else { 49 | & $winget upgrade --id $item.id --silent --accept-package-agreements --accept-source-agreements 50 | } 51 | } 52 | } #foreach 53 | } 54 | elseif ($pscmdlet.ParameterSetName -eq 'all' -AND $IncludeUnknown) { 55 | if ($pscmdlet.ShouldProcess("all installed and unknown packages")) { 56 | & $winget upgrade --all --include-unknown --silent 57 | } 58 | } 59 | elseif ($pscmdlet.ParameterSetName -eq 'all') { 60 | if ($pscmdlet.ShouldProcess("all installed")) { 61 | & $winget upgrade --all --silent 62 | } 63 | } 64 | else { 65 | Write-Warning "No packages detected." 66 | } 67 | } #process 68 | 69 | End { 70 | If (-not $processed) { 71 | Write-Warning "No packages detected from the pipeline" 72 | } 73 | Write-Verbose "Ending $($MyInvocation.MyCommand)" 74 | } #end 75 | } 76 | -------------------------------------------------------------------------------- /functions/Test-WGVersion.ps1: -------------------------------------------------------------------------------- 1 | 2 | 3 | Function Test-WGVersion { 4 | [cmdletbinding()] 5 | [OutputType("Boolean", "WGVersion")] 6 | Param( 7 | [Parameter(ValueFromPipeline)] 8 | [switch]$Quiet 9 | ) 10 | Begin { 11 | Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Starting $($myinvocation.mycommand)" 12 | } #begin 13 | 14 | Process { 15 | #not using Get-Appx package because it doesn't work in older versions of PowerShell 7 16 | [version]$local = (winget --version).replace("v", "") 17 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Found installed version $local" 18 | $note = Get-WGReleaseNote 19 | [version]$remote = $note.version.replace("v", "") 20 | 21 | if ($quiet) { 22 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Getting boolean result" 23 | $remote -gt $local 24 | } 25 | else { 26 | Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Getting full result" 27 | [PSCustomObject]@{ 28 | PSTypeName = "WGVersion" 29 | Installed = $local 30 | Online = $remote 31 | Update = $remote -gt $local 32 | Command = (Get-Command winget).source 33 | Link = $note.link 34 | ComputerName = $env:COMPUTERNAME 35 | } 36 | } 37 | } #process 38 | 39 | End { 40 | Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)" 41 | } #end 42 | 43 | } #close Test-WGVersion -------------------------------------------------------------------------------- /functions/private.ps1: -------------------------------------------------------------------------------- 1 | 2 | #define a private function to convert the output 3 | 4 | Function _convert { 5 | [cmdletbinding()] 6 | Param( 7 | [Parameter(Mandatory)] 8 | [object]$Package 9 | ) 10 | Begin { 11 | Write-Verbose "[$((Get-Date).TimeofDay) CONVERT] Processing package data" 12 | } 13 | Process { 14 | #9/19/2022 filter out Release Notes because the content is often not properly 15 | #formatted for yaml and I'm not using it anyway. 16 | 17 | $list = [System.Collections.Generic.list[string]]::new() 18 | $package.replace(" - ", " ").replace('ÔÇó', "*") -replace "[^\s\w\.\:\/~\,-]", "" | 19 | Select-Object -Skip 1 | 20 | Where-Object { $_ -match "^(\s+)?(\b(\w+)\b).*:" } | 21 | ForEach-Object { $list.Add($_) } 22 | 23 | $i = $list.FindIndex({ $args[0] -match "^Release Notes:" }) 24 | $j = $list.FindIndex({ $args[0] -match "^Installer:" }) 25 | if ($i -gt 0 -AND $j -gt $i) { 26 | Write-Verbose "[$((Get-Date).TimeofDay) CONVERT] Removing lines $i to $($j-1)" 27 | $list.RemoveRange($i, ($j - $i)) 28 | } 29 | 30 | Try { 31 | Write-Verbose "[$((Get-Date).TimeofDay) CONVERT] Converting to YAML" 32 | $yml = $list | ConvertFrom-Yaml -ErrorAction stop 33 | } 34 | Catch { 35 | Write-Warning "Failed to convert to YAML. $($_.exception.message)" 36 | $package | Out-String | Write-Warning 37 | } 38 | 39 | [regex]$rxname = "(?(?<=\w\s).*)(?=\s\[(?[\S\.]+)\])" 40 | $online = _parseVersion $yml.$($localized.version) 41 | 42 | $out = [wgPackage]::new() 43 | $out.Name = $rxname.match($package[0]).groups["name"].value 44 | $out.ID = $rxname.match($package[0]).groups["id"].value 45 | $out.Version = $online 46 | $out.Publisher = $yml.$($localized.Publisher) 47 | $out.PublisherUrl = $yml.$($localized.PublisherURL) 48 | $out.PublisherSupportUrl = $yml.$($localized.PublisherSupportUrl) 49 | $out.Author = $yml.$($localized.Author) 50 | $out.Moniker = $yml.$($localized.Moniker) 51 | $out.Description = $yml.$($localized.Description) 52 | $out.Homepage = $yml.$($Localized.homepage) 53 | $out.Source = $Source 54 | 55 | $out 56 | 57 | } 58 | End { 59 | Write-Verbose "[$((Get-Date).TimeofDay) CONVERT] Ending conversion" 60 | } 61 | } 62 | 63 | #parse the winget output into a list object 64 | Function _parseShowData { 65 | [cmdletbinding()] 66 | Param ([string[]]$PackageData) 67 | 68 | $list = [System.Collections.Generic.list[string]]::new() 69 | $list.add($packageData[0]) 70 | for ($i = 1; $i -lt $packagedata.count; $i++) { 71 | if ($PackageData[$i] -match ":\s\w+") { 72 | $list.add($PackageData[$i].trim()) 73 | } 74 | } 75 | #winget doesn't always return the exact data for every package, 76 | $list 77 | } 78 | Function _parseVersion { 79 | #parse out odd characters from version strings 80 | [cmdletbinding()] 81 | Param([string[]]$VersionString) 82 | 83 | $out = @() 84 | foreach ($v in $VersionString) { 85 | 86 | if ($v -match "unknown") { 87 | $out += $null 88 | } 89 | elseif ($v -match "[\<\>]") { 90 | $out += ($v -replace $matches.values, "").Trim() 91 | } 92 | else { 93 | $out += $v.Trim() 94 | } 95 | } 96 | 97 | $out 98 | } 99 | -------------------------------------------------------------------------------- /images/get-wginstalled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wginstalled.png -------------------------------------------------------------------------------- /images/get-wgpackage-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wgpackage-1.png -------------------------------------------------------------------------------- /images/get-wgpackage-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wgpackage-2.png -------------------------------------------------------------------------------- /images/get-wgreleasenote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wgreleasenote.png -------------------------------------------------------------------------------- /images/get-wgupgrade-bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wgupgrade-bug.png -------------------------------------------------------------------------------- /images/get-wgupgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/get-wgupgrade.png -------------------------------------------------------------------------------- /images/install-upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/install-upgrade.png -------------------------------------------------------------------------------- /images/install-winget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/install-winget.png -------------------------------------------------------------------------------- /images/releasenote-markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/releasenote-markdown.png -------------------------------------------------------------------------------- /images/update-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdhitsolutions/WingetTools/6504cec5dc68a138fc4c7b068ef5b7dec8cccfef/images/update-view.png -------------------------------------------------------------------------------- /tests/WingetTools.tests.ps1: -------------------------------------------------------------------------------- 1 | $here = Split-Path -Path $MyInvocation.MyCommand.Path 2 | $parent = Split-Path -Path $here 3 | $module = Split-Path -Path $parent -Leaf 4 | 5 | Write-Host "Importing module $module from $parent" -ForegroundColor Cyan 6 | 7 | Import-Module $parent -force 8 | 9 | InModuleScope $Module { 10 | Describe WingetTools { 11 | It "does something useful" { 12 | $true | Should Be $true 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /types/wginstalled.types.ps1xml: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 9 | WGInstalled 10 | 11 | 12 | versionInfo 13 | 14 | ID 15 | InstalledVersion 16 | OnlineVersion 17 | Update 18 | 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------