### Get-WGPackage Usage Examples Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPackage.md Examples demonstrating how to retrieve package information by name, ID, and via pipeline input. ```powershell PS C:\> Get-WGPackage -name "Foxit PDF Reader" Name ID Version Description ---- -- ------- ----------- Foxit PDF Reader Foxit.FoxitReader 12.0.1.12430 Foxit is a powerful PDF reader for viewing, filling out forms and more. ``` ```powershell PS C:\> Get-WGPackage -id "Microsoft.Powershell.Preview" | Select-Object * Moniker : pwsh-preview Description : PowerShell is a cross-platform Windows, Linux, and macOS automation and configuration tool/frame work that works well with your existing tools and is optimized for dealing with structured data e.g. JSON, CSV, XML, etc., REST APIs, and object models. Author : Microsoft Corporation Publisher : Microsoft Corporation PublisherUrl : https://github.com/PowerShell/PowerShell PublisherSupportUrl : https://github.com/PowerShell/PowerShell/issues Homepage : https://microsoft.com/PowerShell Name : PowerShell Preview ID : Microsoft.PowerShell.Preview Version : 7.3.7.0 Source : winget Computername : WIN11DESK ``` ```powershell PS C:\> winget search --tag powerbi | Get-WGPackage | Select-Object Name,ID,Version Name ID Version ---- -- ------- Microsoft PowerBI Desktop Microsoft.PowerBI 2.109.642.0 DAX Studio DaxStudio.DaxStudio 3.0.0.725 ``` -------------------------------- ### Get-WGPackage Output Example Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Example of the object properties returned by the Get-WGPackage command. ```text Moniker : gh Description : gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code. Author : GitHub, Inc. Publisher : GitHub, Inc. PublisherUrl : https://github.com PublisherSupportUrl : https://help.github.com/en Homepage : https://github.com/cli/cli Name : GitHub CLI ID : GitHub.cli Version : 2.15.0 Source : winget Computername : WIN11DESK ``` -------------------------------- ### Get Winget Upgrades by ID Pattern and Select Properties Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGUpgrade.md Retrieves available winget upgrades where the package ID starts with 'micro'. It then selects and displays the Name, Version, and Available properties. Note that the 'Installed' column header corresponds to the 'Version' property in the output object. ```powershell PS C:\> Get-WGUpgrade -id micro* | Select-Object Name,Version,Available Name Version Available ---- ------- --------- Visual Studio Community 2019 16.11.18 16.11.19 Windows Software Development Kit 10.0.22000.832 10.0.22621.1 Microsoft SQL Server Management Studio 18.12 18.12.1 PowerToys (Preview) 0.62.0 0.62.1 ``` -------------------------------- ### Install-WinGet Usage Example Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Basic usage of the Install-WinGet command. ```powershell PS C:\> Install-Winget ``` -------------------------------- ### Test Winget Version (Default Output) Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Test-WGVersion.md Run Test-WGVersion without parameters to get a detailed object showing installed and online versions, and whether an update is available. The 'Update' field will be green if an update is available in a compatible console. ```powershell PS C:\> Test-WGVersion Installed Online Update Command --------- ------ ------ ------- 1.1.13405 1.1.12653 False C:\Users\Jeff\AppData\Local\Microsoft\Windo… ``` -------------------------------- ### Install Latest Winget Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Installs the latest stable or preview version of winget directly from GitHub. Requires a Windows PowerShell session. Use -WhatIf to preview the installation or -Passthru to return the AppxPackage object. ```powershell # Install the latest stable version of winget from GitHub Install-WinGet ``` ```powershell # Install the latest preview/insider build Install-WinGet -Preview ``` ```powershell # Preview what would happen without actually installing Install-WinGet -WhatIf ``` ```powershell # Install and return the AppxPackage object Install-WinGet -Passthru ``` ```powershell # Output: # Name : Microsoft.DesktopAppInstaller # Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, ... # Architecture : X64 # Version : 1.19.10000.0 ``` -------------------------------- ### Install WingetTools Module Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Installs the WingetTools module from the PowerShell Gallery. ```powershell Install-Module WingetTools ``` -------------------------------- ### Get Installed Winget Packages Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Lists all packages currently installed via the winget package manager. ```powershell Get-WGInstalled ``` -------------------------------- ### Install Winget Package Manager Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Installs the latest version of winget from GitHub. Requires PowerShell 5.1+ on Windows 10 or 11. Installs DesktopAppInstaller if not present. ```powershell Install-WinGet ``` -------------------------------- ### Get-WGInstalled Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/about_WingetTools.md Lists all packages installed via winget. ```APIDOC ## Get-WGInstalled ### Description Retrieves a list of all packages installed using winget as the source. ### Method PowerShell Command ### Endpoint Get-WGInstalled ``` -------------------------------- ### Get Installed Winget Packages Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGInstalled.md Retrieves a list of all packages installed using the winget package manager. It is recommended to save the output to a variable due to potential processing overhead. ```powershell PS C:\> Get-WGInstalled -outvariable in Name ID Version Description ---- -- ------- ----------- Visual Studio Community Microsoft.VisualStudio.20 16.11.10 The Community edition of Visual Studio, an 2019 19.Community integrated development environment (IDE) from Microsoft. Individual developers have no restrictions on their use of the Community edition. Audacity Audacity.Audacity 3.1.3 Audacity is a free, easy-to-use, multi-track audio editor and recorder for Windows, macOS, GNU/Linux and other operating systems. Ubuntu Canonical.Ubuntu 2004.2021.825.0 Ubuntu on Windows allows you to use Ubuntu Terminal and run Ubuntu command line utilities including bash, ssh, git, apt and many more. This is the latest LTS release. CCleaner Piriform.CCleaner 6.00 CCleaner is a utility used to clean potentially unwanted files and invalid Windows Registry entries from a computer. ... ``` -------------------------------- ### Get-WGInstalled Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves all packages installed via winget with version comparison information. ```APIDOC ## Get-WGInstalled ### Description Retrieves all packages currently installed via winget and returns them as PowerShell objects, including version comparison data to identify available updates. ### Parameters #### Query Parameters - **OutVariable** (String) - Optional - Variable name to store the output for performance. ``` -------------------------------- ### Upgrade packages matching a pattern with WhatIf Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md This example demonstrates how to preview upgrades for packages matching a name pattern using the -WhatIf parameter. It pipes the output of Get-WGUpgrade to Invoke-WGUpgrade. ```powershell Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf ``` -------------------------------- ### Select and upgrade packages interactively Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md This snippet shows how to pipe available upgrades to Out-GridView for interactive selection, and then pass the selected items to Invoke-WGUpgrade for installation. ```powershell Get-WGUpgrade | Out-GridView -OutputMode Multiple | Invoke-WGUpgrade ``` -------------------------------- ### Install-WinGet Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Installs the latest winget release from GitHub on Windows 10 or 11. ```APIDOC ## Install-WinGet ### Description Installs the latest winget release from GitHub. This command requires a Windows PowerShell session on Windows 10 or 11 and automatically handles the Microsoft.VCLibs.140.00.UWPDesktop dependency. ### Parameters #### Optional Parameters - **Preview** (SwitchParameter) - Optional - Install the latest preview build. - **Passthru** (SwitchParameter) - Optional - Display the AppxPackage after installation. - **WhatIf** (SwitchParameter) - Optional - Shows what would happen if the cmdlet runs. - **Confirm** (SwitchParameter) - Optional - Prompts for confirmation before running. ### Request Example Install-Winget ### Response #### Success Response - **AppxPackage** (Object) - Returns the installed AppxPackage object if -Passthru is specified. ``` -------------------------------- ### Format Installed Packages for Update View Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGInstalled.md Formats the output of Get-WGInstalled to display a table view that highlights potential updates for installed packages. This view helps quickly identify which packages have newer versions available. ```powershell PS C\> $in | format-table -view update ID InstalledVersion OnlineVersion Update -- ---------------- ------------- ------ Microsoft.VisualStudio.2019.Community 16.11.10 16.11.17 True Audacity.Audacity 3.1.3 3.1.3 False Piriform.CCleaner 6.00 6.01 True Canonical.Ubuntu 2004.2021.825.0 2004.2021.825.0 False Discord.Discord 1.0.9003 1.0.9005 True Foxit.FoxitReader 12.0.0.12394 12.0.1.12430 True Git.Git 2.37.1 2.37.1 False ``` -------------------------------- ### Install-WinGet Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Downloads and installs the latest winget release from GitHub, handling dependencies automatically. ```APIDOC ## Install-WinGet ### Description Downloads and installs the latest winget release directly from GitHub. This command must be run in a Windows PowerShell session on Windows 10 or 11. ### Parameters #### Query Parameters - **Preview** (Switch) - Optional - Install the latest preview/insider build. - **WhatIf** (Switch) - Optional - Preview what would happen without actually installing. - **Passthru** (Switch) - Optional - Return the AppxPackage object after installation. ``` -------------------------------- ### Get All Available Winget Upgrades Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGUpgrade.md Retrieves all available upgrades for installed winget packages. This is the default behavior when no parameters are specified. ```powershell PS C:\> Get-WGUpgrade Name ID Installed Available ---- -- --------- --------- Discord Discord.Discord 1.0.9005 1.0.9006 Visual Studio Community 2019 Microsoft.VisualStudio.2019.Community 16.11.18 16.11.19 Spotify Spotify.Spotify 1.1.91.824.g07f1e963 1.1.93.896.g3ae3b4f3 VSCodium VSCodium.VSCodium 1.71.1.22256 1.71.2.22258 Camtasia TechSmith.Camtasia 22.0.4.39133 22.1.1.39848 Windows Software Development Kit Microsoft.WindowsSDK 10.0.22000.832 10.0.22621.1 Microsoft SQL Server Management Studio Microsoft.SQLServerManagementStudio 18.12 18.12.1 PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 ESET Endpoint Security ESET.EndpointSecurity 9.0.2046.0 9.1.2057.0 ``` -------------------------------- ### Test Winget Version and Install Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Checks if a Winget update is available and optionally installs it. Useful for scripting and conditional logic. ```powershell Test-WGVersion -Quiet ``` ```powershell if (Test-WGVersion -Quiet) { Write-Host "Winget update available!" -ForegroundColor Green Install-WinGet } else { Write-Host "Winget is up to date." -ForegroundColor Cyan } ``` ```powershell Test-WGVersion | Select-Object Installed, Online, Command ``` -------------------------------- ### Preview Upgrades Without Installing (WhatIf) Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Uses the WhatIf parameter to preview which package upgrades would be performed without actually installing them. This is useful for verifying the scope of an upgrade operation. ```powershell Get-WGUpgrade -Name "p*" | Invoke-WGUpgrade -WhatIf ``` -------------------------------- ### View Installed Packages in Update Table Format Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Displays installed packages in a table format, highlighting which packages have available updates. This view is useful for a quick overview of upgradable software. ```powershell $installed | Format-Table -View update ``` -------------------------------- ### Get-WGInstalled Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGInstalled.md Retrieves a list of packages installed using the winget package manager. It can optionally filter by a specific source. ```APIDOC ## GET /api/winget/installed ### Description Retrieves a list of all packages installed with winget. This command is designed to work with packages that have 'winget' as their source. ### Method GET ### Endpoint /api/winget/installed ### Parameters #### Query Parameters - **Source** (String) - Optional - Specify a winget source. Defaults to 'winget'. ### Request Example ```json { "example": "GET /api/winget/installed?Source=winget" } ``` ### Response #### Success Response (200) - **Name** (String) - The name of the installed package. - **ID** (String) - The unique identifier of the installed package. - **Version** (String) - The installed version of the package. - **Description** (String) - A brief description of the package. #### Response Example ```json { "example": [ { "Name": "Visual Studio Community", "ID": "Microsoft.VisualStudio.2019.Community", "Version": "16.11.10", "Description": "The Community edition of Visual Studio, an integrated development environment (IDE) from Microsoft. Individual developers have no restrictions on their use of the Community edition." }, { "Name": "Audacity", "ID": "Audacity.Audacity", "Version": "3.1.3", "Description": "Audacity is a free, easy-to-use, multi-track audio editor and recorder for Windows, macOS, GNU/Linux and other operating systems." } ] } ``` ``` -------------------------------- ### Get Available Winget Package Updates Filtered by Name Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Retrieves available updates for winget packages, specifically filtering for packages whose names match the pattern 'toys*'. The output is formatted as a table, showing key details like source, computer name, package name, ID, installed version, and available version. ```dos PS C:\> Get-WGUpgrade -Name *toys* | select * Source : winget Computername : PROSPERO Name : PowerToys (Preview) ID : Microsoft.PowerToys Version : 0.58.0 Available : 0.61.1 ``` -------------------------------- ### Invoke-WGUpgrade Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Executes winget package upgrades using silent installation mode with automatic license acceptance. ```APIDOC ## POST Invoke-WGUpgrade ### Description Executes winget package upgrades using silent installation mode with automatic license acceptance. Supports WhatIf for previewing actions, piped input from Get-WGUpgrade, and interactive selection via Out-GridView. ### Method POST ### Parameters #### Request Body - **ID** (string) - Optional - The ID of the specific package to upgrade. - **All** (switch) - Optional - Upgrade all available packages. - **IncludeUnknown** (switch) - Optional - Include packages with unknown versions when using -All. - **WhatIf** (switch) - Optional - Preview the operation without executing. - **Confirm** (switch) - Optional - Prompt for confirmation before each upgrade. ``` -------------------------------- ### Get Winget Upgrades by Name Pattern Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGUpgrade.md Filters available winget upgrades to show only those whose names start with 'P'. Wildcards are permitted for the -Name parameter. ```powershell PS C:\> get-wgupgrade p* Name ID Installed Available ---- -- --------- --------- PowerToys (Preview) Microsoft.PowerToys 0.62.0 0.62.1 ``` -------------------------------- ### Get Winget Package Upgrades Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Generates PowerShell objects representing available upgrades for installed winget packages. Formatted as a table by default. ```powershell Get-WGUpgrade ``` -------------------------------- ### List Installed Winget Packages Filtered by Publisher Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Retrieves a list of all packages installed via winget, filtering the output to show only those published by Google. Displays detailed properties of each package. ```powershell PS C:\> Get-WGInstalled | where publisher -match google | select * Name : Google Drive ID : Google.Drive InstalledVersion : 61.0.3.0 OnlineVersion : 61.0.3.0 Publisher : Google LLC PublisherUrl : https://www.google.com Author : Google LLC Moniker : google-drive Description : Mounts Google Drive(s) as a share drive and streams files as needed from the cloud. Alternative to Google Backup and Sync. Homepage : https://www.google.com/drive/download/ Source : winget Computername : PROSPERO Update : False Name : Google Chrome ID : Google.Chrome InstalledVersion : 104.0.5112.81 OnlineVersion : 104.0.5112.81 Publisher : Google LLC PublisherUrl : https://www.google.com Author : Google LLC Moniker : chrome Description : A fast, secure, and free web browser built for the modern web. Chrome syncs bookmarks across all your devices, fills out forms automatically, and so much more. Homepage : https://www.google.com/chrome Source : winget Computername : PROSPERO Update : False ``` -------------------------------- ### Filter Installed Packages by Publisher Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Use this to filter the list of installed packages to find those published by a specific entity. Requires the `$installed` variable to be populated with package data. ```powershell $installed | Where-Object Publisher -match "google" | Select-Object * ``` -------------------------------- ### Get-WGUpgrade - Retrieve Available Winget Upgrades Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGUpgrade.md The Get-WGUpgrade cmdlet retrieves information about available upgrades for packages installed via winget. It can filter upgrades by package name or ID. The output includes details like the package name, ID, installed version, and available version. ```APIDOC ## GET /api/winget/upgrades ### Description Retrieves a list of available upgrades for installed winget packages. ### Method GET ### Endpoint /api/winget/upgrades ### Parameters #### Query Parameters - **Name** (string) - Optional - Specify a package by name. Wildcards are permitted. - **ID** (string) - Optional - Specify a package by ID. Wildcards are permitted. ### Request Example ```json { "example": "GET /api/winget/upgrades?Name=p*" } ``` ### Response #### Success Response (200) - **Name** (string) - The name of the package. - **ID** (string) - The unique identifier of the package. - **Installed** (string) - The currently installed version of the package. - **Available** (string) - The latest available version of the package. #### Response Example ```json { "example": [ { "Name": "Discord", "ID": "Discord.Discord", "Installed": "1.0.9005", "Available": "1.0.9006" }, { "Name": "Visual Studio Community 2019", "ID": "Microsoft.VisualStudio.2019.Community", "Installed": "16.11.18", "Available": "16.11.19" } ] } ``` ``` -------------------------------- ### Test-WGVersion Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Test-WGVersion.md Checks if the installed Winget version is up to date compared to the latest online release. ```APIDOC ## Test-WGVersion ### Description Test-WGVersion is a command used to discover if you need to update winget. It compares the currently installed version with the latest stable version available online. ### Parameters #### Optional Parameters - **Quiet** (SwitchParameter) - Optional - If provided, returns a Boolean result indicating if an update is available instead of an object. ### Request Example Test-WGVersion ### Response #### Success Response (200) - **Installed** (String) - The currently installed version of Winget. - **Online** (String) - The latest stable version available online. - **Update** (Boolean) - Indicates if an update is available. - **Command** (String) - The path to the Winget executable. #### Response Example Installed Online Update Command --------- ------ ------ ------- 1.1.13405 1.1.12653 False C:\Users\Jeff\AppData\Local\Microsoft\Windo… ``` -------------------------------- ### Get Latest Preview Release Note Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGReleaseNote.md Retrieves the latest preview release note for winget. The output indicates 'Prerelease : True' and includes notes specific to development builds with experimental features enabled. ```powershell PS C:\> Get-WGReleaseNote -Preview Name : Windows Package Manager v1.1.12701 Version : v1.1.12701 Published : 9/28/2021 10:30:01 AM Prerelease : True Notes : This release is the first development build after the Windows Package Manager 1.1 release candidate build for Windows 10 (1809+). Experimental features have been enabled in this release. This build will be released to Windows Insider Dev builds, and Windows Package Manager Insiders. ``` -------------------------------- ### Get Winget Release Notes Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Retrieves the latest release notes for the winget project from GitHub. Can display notes in markdown or as a link to the online version. ```powershell Get-WGReleaseNote ``` -------------------------------- ### Get Winget Release Notes Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves release notes for winget from GitHub. Supports stable and preview releases, with options to display as markdown, open in a browser, or extract specific properties. Use -AsMarkdown with Show-Markdown for PowerShell 7. ```powershell # Get the latest release note as a PowerShell object Get-WGReleaseNote ``` ```powershell # Output: # Name : Windows Package Manager v1.3.2091 # Version : v1.3.2091 # Published : 9/27/2023 6:08:01 PM # Prerelease : False # Notes : This release represents our Windows Package Manager release... # Link : https://github.com/microsoft/winget-cli/releases/tag/v1.3.2091 ``` ```powershell # Get release note as markdown (useful in PowerShell 7) Get-WGReleaseNote -AsMarkdown | Show-Markdown ``` ```powershell # Get the latest preview release note Get-WGReleaseNote -Preview ``` ```powershell # Open the release note page in your default browser Get-WGReleaseNote -Online ``` ```powershell # Extract specific properties Get-WGReleaseNote | Select-Object Name, Version, Published ``` -------------------------------- ### Upgrade a Specific Package by ID Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Executes the upgrade for a specified winget package using its ID. This command performs a silent installation with automatic license acceptance. ```powershell Invoke-WGUpgrade -ID "Microsoft.VC++2015-2019Redist-x64" ``` -------------------------------- ### Find All Packages with Available Updates Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Filters the installed packages to show only those that have a newer version available online. This is a direct way to identify software needing an update. ```powershell $installed | Where-Object Update -eq $true ``` -------------------------------- ### Check if Winget Needs Updating Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Compares the installed winget version with the latest release on GitHub to determine if an update is available. Displays version information with a color-coded update status. ```powershell Test-WGVersion ``` -------------------------------- ### Get Latest Winget Release Note Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGReleaseNote.md Retrieves the default output for the latest winget release note. The output includes details like Name, Version, Published date, Prerelease status, Notes, and the GitHub Link. ```powershell PS C:\> Get-WGReleaseNote Name : Windows Package Manager v1.1.12653 Version : v1.1.12653 Published : 9/27/2021 6:08:01 PM Prerelease : False Notes : This release represents our Windows Package Manager 1.release candidate build for Windows 10 (1809+). Experimental features have been disabled in this release. We will follow this release with another Pre-release "developer" build at GitHub so users can continue with experimental features available. # Bugs #797 Silent install of "winget install git.git" is not working #1497 Make rename retry more frequently for longer, then try making a hardlink Link : https://github.com/microsoft/winget-cli/releases/tag/v1.1.12653 ``` -------------------------------- ### Get Winget Upgrades by ID Pattern and Select Properties Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves available winget upgrades matching a specified ID pattern and then selects specific properties (Name, Version, Available) for display. This allows for focused information retrieval. ```powershell Get-WGUpgrade -ID "micro*" | Select-Object Name, Version, Available ``` -------------------------------- ### Get Winget Upgrades by Name Pattern Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves available winget upgrades that match a specified name pattern, supporting wildcards. Useful for targeting specific applications or groups of applications for updates. ```powershell Get-WGUpgrade -Name "p*" ``` -------------------------------- ### Get Winget Package Details Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves detailed package information from the winget repository. Search by name, ID, or moniker. Can accept piped input from native winget search commands. Use Select-Object * to view all properties. ```powershell # Get a package by name Get-WGPackage -Name "GitHub CLI" ``` ```powershell # Output: # Name ID Version Description # ---- -- ------- ----------- # GitHub CLI GitHub.cli 2.15.0 gh is GitHub on the command line... ``` ```powershell # Get a package by ID and view all properties Get-WGPackage -ID "Microsoft.PowerShell.Preview" | Select-Object * ``` ```powershell # Output: # Moniker : pwsh-preview # Description : PowerShell is a cross-platform automation tool... # Author : Microsoft Corporation # Publisher : Microsoft Corporation # PublisherUrl : https://github.com/PowerShell/PowerShell # PublisherSupportUrl : https://github.com/PowerShell/PowerShell/issues # Homepage : https://microsoft.com/PowerShell # Name : PowerShell Preview # ID : Microsoft.PowerShell.Preview # Version : 7.3.7.0 # Source : winget # Computername : WIN11DESK ``` ```powershell # Get a package by moniker Get-WGPackage -Moniker "gh" ``` ```powershell # Pipe winget search results to get detailed info on multiple packages winget search --tag powerbi | Get-WGPackage | Select-Object Name, ID, Version ``` ```powershell # Output: # Name ID Version # ---- -- ------- # Microsoft PowerBI Desktop Microsoft.PowerBI 2.109.642.0 # DAX Studio DaxStudio.DaxStudio 3.0.0.725 ``` ```powershell # Search by tag and get full package details winget search --tag github --source winget | Get-WGPackage ``` -------------------------------- ### Get Winget Executable Path Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves the full path to the winget.exe executable. Essential for running winget under contexts like SYSTEM where PATH resolution might fail. ```powershell Get-WGPath ``` ```powershell $wingetPath = Get-WGPath if (Test-Path $wingetPath) { & $wingetPath --version } ``` ```powershell $winget = Get-WGPath Start-Process -FilePath $winget -ArgumentList "upgrade --all --silent" -Wait ``` -------------------------------- ### Get Winget Package Information Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Retrieves detailed information about a specific winget package, returning a PowerShell object. Can also process piped output from 'winget search'. ```powershell Get-WGPackage ``` ```powershell winget search --tag github --source winget | Get-WGPackage ``` -------------------------------- ### Get Current Culture Information Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Retrieves the current culture settings of the operating system. This command is used to help diagnose localization issues with winget output parsing by providing the current culture context. ```powershell Get-Culture ``` -------------------------------- ### Check for Winget Version Updates Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Tests if a new version of the winget tool itself is available from Github. Displays the installed version, the latest online version, and a boolean indicating if an update is available. If an update is available, the 'Update' column will be highlighted in green in compatible terminals. ```dos PS C:\> Test-WGVersion Installed Online Update Command --------- ------ ------ ------- 1.3.2091 1.3.2091 False C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\winget.exe ``` -------------------------------- ### Get Winget Package Information for Localization Testing Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Retrieves detailed information about a specific package (Microsoft PowerShell) from the winget source. This command is used in conjunction with Get-Culture to help diagnose localization issues with winget output parsing. ```powershell winget show --id microsoft.powershell --source winget ``` -------------------------------- ### Simulate Winget Package Upgrades with WhatIf Source: https://github.com/jdhitsolutions/wingettools/blob/main/README.md Demonstrates the use of Invoke-WGUpgrade with the -WhatIf parameter to simulate the upgrade process for packages matching the name pattern 'p*'. This shows the intended upgrade operations without actually performing them. ```dos PS C:\> Get-WGUpgrade -Name p* | Invoke-WGUpgrade -WhatIf What if: Performing the operation "Upgrade from 3.2.0+06857 to 3.3.1+06924" on target "PrivateInternetAccess.PrivateInternetAccess". What if: Performing the operation "Upgrade from 0.58.0 to 0.61.1" on target "Microsoft.PowerToys". What if: Performing the operation "Upgrade from 3.10.3 to 3.10.6" on target "Python.Python.3". ``` -------------------------------- ### Install-WinGet Syntax Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Defines the syntax for the Install-WinGet command including optional parameters. ```yaml Install-WinGet [-Preview] [-Passthru] [-WhatIf] [-Confirm] [] ``` -------------------------------- ### Get-WGPackage Parameter Definitions Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPackage.md YAML-based definitions for individual cmdlet parameters. ```yaml Type: String Parameter Sets: id Aliases: Required: False Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` ```yaml Type: String[] Parameter Sets: input Aliases: Required: False Position: Named Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ```yaml Type: String Parameter Sets: moniker Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: String Parameter Sets: name Aliases: Required: False Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` ```yaml Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: winget Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Get-WGPackage Syntax Definitions Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPackage.md YAML-based syntax definitions for the various parameter sets available in Get-WGPackage. ```yaml Get-WGPackage [[-Name] ] [-Source ] [] ``` ```yaml Get-WGPackage [-ID ] [-Source ] [] ``` ```yaml Get-WGPackage [-Moniker ] [-Source ] [] ``` ```yaml Get-WGPackage [-InputObject ] [-Source ] [] ``` -------------------------------- ### Get-WGPackage Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves detailed package information from the winget repository as rich PowerShell objects. ```APIDOC ## Get-WGPackage ### Description Retrieves detailed package information from the winget repository. Supports searching by name, ID, or moniker, and accepts piped input from native winget search commands. ### Parameters #### Query Parameters - **Name** (String) - Optional - Search for a package by name. - **ID** (String) - Optional - Search for a package by ID. - **Moniker** (String) - Optional - Search for a package by moniker. ``` -------------------------------- ### Get-WGPackage Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/about_WingetTools.md Retrieves package details as a PowerShell object. ```APIDOC ## Get-WGPackage ### Description Wraps winget.cmd to retrieve package information and returns it as a PowerShell object with properties like Name, ID, Version, and Publisher. ### Method PowerShell Command ### Endpoint Get-WGPackage ``` -------------------------------- ### Retrieve package details via pipeline Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/about_WingetTools.md Pipes the output of a winget search command into Get-WGPackage to convert package information into PowerShell objects. ```powershell winget search --tag github --source winget | Get-WGPackage ``` -------------------------------- ### Preview Parameter Definition Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Configuration details for the Preview switch parameter. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Upgrade all packages including unknown versions Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md Use the -IncludeUnknown parameter along with -All to upgrade packages even if their current version cannot be determined by winget. ```powershell Invoke-WGUpgrade -All -IncludeUnknown ``` -------------------------------- ### Get-WGUpgrade Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/about_WingetTools.md Retrieves available package upgrades as PowerShell objects. ```APIDOC ## Get-WGUpgrade ### Description Returns PowerShell objects representing available package upgrades, suitable for piping to upgrade commands. ### Method PowerShell Command ### Endpoint Get-WGUpgrade ``` -------------------------------- ### Upgrade all available packages Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md This command upgrades all packages that have available updates. It is equivalent to running 'winget upgrade --all'. ```powershell Invoke-WGUpgrade -all ``` -------------------------------- ### Upgrade All Packages Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Initiates the upgrade process for all available winget packages. This command upgrades all software managed by winget that has a newer version available. ```powershell Invoke-WGUpgrade -All ``` -------------------------------- ### Get-WGReleaseNote Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGReleaseNote.md Retrieves the latest release note for the winget project from Github. Supports outputting in markdown format or opening the online version. ```APIDOC ## GET /winget/release-note ### Description Retrieves the latest release note for the winget project. This command queries the Github repository for the winget project and displays the release note for the latest version. It can also output the release note in markdown format or navigate to the online version. ### Method GET ### Endpoint /winget/release-note ### Query Parameters - **AsMarkdown** (SwitchParameter) - Optional - If present, the release note will be formatted as markdown. - **Online** (SwitchParameter) - Optional - If present, the command will open the release note in the default web browser. - **Preview** (SwitchParameter) - Optional - If present, the command will retrieve the latest preview release note instead of the stable release. ### Request Example ```json { "query": "Get-WGReleaseNote -AsMarkdown" } ``` ### Response #### Success Response (200) - **Name** (String) - The name of the release. - **Version** (String) - The version number of the release. - **Published** (DateTime) - The date and time the release was published. - **Prerelease** (Boolean) - Indicates if the release is a pre-release. - **Notes** (String) - The release notes content. - **Link** (String) - The URL to the release on Github. #### Response Example ```json { "Name": "Windows Package Manager v1.1.12653", "Version": "v1.1.12653", "Published": "2021-09-27T18:08:01", "Prerelease": false, "Notes": "This release represents our Windows Package Manager 1.release candidate build for Windows 10 (1809+).\n\nExperimental features have been disabled in this release. We will follow this release with another Pre-release \"developer\" build at GitHub so users can continue with experimental features available.\n\n# Bugs\n#797 Silent install of \"winget install git.git\" is not working\n#1497 Make rename retry more frequently for longer, then try making a hardlink", "Link": "https://github.com/microsoft/winget-cli/releases/tag/v1.1.12653" } ``` ``` -------------------------------- ### Display Release Note as Markdown Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGReleaseNote.md Pipes the Markdown output of Get-WGReleaseNote to the Show-Markdown cmdlet for display. This is useful in PowerShell 7 environments that support markdown cmdlets. ```powershell PS C:\> Get-WGReleaseNote -asmarkdown | Show-Markdown ``` -------------------------------- ### Confirm Each Upgrade Interactively Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Prompts for confirmation before upgrading each package. This provides an extra layer of control, allowing you to approve each upgrade individually. ```powershell Get-WGUpgrade | Invoke-WGUpgrade -Confirm ``` -------------------------------- ### Get-WGPath Cmdlet Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPath.md Retrieves the full path to the Winget executable, which is useful when running Winget under a system context where the default user context path might not be accessible. ```APIDOC ## Get-WGPath ### Description 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. ### Method GET ### Endpoint /wingettools/Get-WGPath ### Parameters #### Query Parameters - **CommonParameters** (object) - Optional - Supports common parameters like -Debug, -ErrorAction, etc. ### Request Example ```powershell Get-WGPath ``` ### Response #### Success Response (200) - **string** (System.String) - The full path to the Winget executable. #### Response Example ``` C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\Winget.exe ``` ``` -------------------------------- ### WhatIf Parameter Definition Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Configuration details for the WhatIf switch parameter. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: wi Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Invoke-WGUpgrade Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md Upgrades Winget packages by ID, input object, or all available updates. ```APIDOC ## Invoke-WGUpgrade ### Description Invokes a Winget upgrade on available packages. The command skips packages with unknown versions by default, accepts all licenses, and uses silent installation. ### Parameters #### Named Parameters - **ID** (String) - Required (in id set) - Specify a package by ID. Wildcards are permitted. - **InputObject** (Object) - Optional - Specify a wgUpgrade object. Accepts pipeline input. - **All** (SwitchParameter) - Optional - Update all packages. - **IncludeUnknown** (SwitchParameter) - Optional - Upgrade packages even if their current version cannot be determined. Requires the -All parameter. - **WhatIf** (SwitchParameter) - Optional - Shows what would happen if the cmdlet runs. - **Confirm** (SwitchParameter) - Optional - Prompts for confirmation before running. ### Request Example Invoke-WGUpgrade -ID "Microsoft.VC++2015-2019Redist-x64" ### Response - **Output** (None) - The command performs the upgrade operation directly on the system. ``` -------------------------------- ### Get-WGPackage Cmdlet Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPackage.md The Get-WGPackage cmdlet retrieves information about a specified winget package. It supports filtering by package name, ID, moniker, or by piping input from other commands like 'winget search'. ```APIDOC ## Get-WGPackage ### Description Retrieves information about a winget package. ### Method GET (conceptual, as this is a PowerShell cmdlet) ### Endpoint N/A (PowerShell Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Name** (String) - Optional - Specify the winget package name. - **ID** (String) - Optional - Specify the package ID. - **Moniker** (String) - Optional - Specify the winget moniker. - **InputObject** (String[]) - Optional - Pipe a winget search to this function. - **Source** (String) - Optional - Specify a winget source. Defaults to 'winget'. ### Request Example ```powershell # Get package by name Get-WGPackage -Name "Foxit PDF Reader" # Get package by ID and select all properties Get-WGPackage -ID "Microsoft.Powershell.Preview" | Select-Object * # Get packages from a winget search result winget search --tag powerbi | Get-WGPackage | Select-Object Name, ID, Version ``` ### Response #### Success Response (200) Returns an object of type WGPackage containing details about the winget package. #### Response Example ```json { "Name": "Foxit PDF Reader", "ID": "Foxit.FoxitReader", "Version": "12.0.1.12430", "Description": "Foxit is a powerful PDF reader for viewing, filling out forms and more." } ``` #### Error Handling Common PowerShell error handling applies. Specific errors related to winget execution may be surfaced. ``` -------------------------------- ### View All Properties of a Winget Upgrade Object Source: https://context7.com/jdhitsolutions/wingettools/llms.txt Retrieves available winget upgrades matching a name pattern and displays all available properties of the upgrade objects. This is helpful for exploring all details of a specific upgrade. ```powershell Get-WGUpgrade -Name "*toys*" | Select-Object * ``` -------------------------------- ### Select Specific Properties of Release Note Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGReleaseNote.md Retrieves the latest winget release note and selects only the Name, Version, and Published properties for display. This demonstrates that the output is an object. ```powershell PS C:\> Get-WGReleaseNote | Select-Object Name,Version,Published Name Version Published ---- ------- --------- Windows Package Manager v1.1.12653 v1.1.12653 9/27/2021 6:08:01 PM ``` -------------------------------- ### Invoke-WGUpgrade Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/about_WingetTools.md Performs a silent upgrade for a specified package. ```APIDOC ## Invoke-WGUpgrade ### Description Wraps the winget upgrade functionality to perform silent upgrades, automatically accepting licenses and agreements. ### Method PowerShell Command ### Endpoint Invoke-WGUpgrade ``` -------------------------------- ### Upgrade a specific package by ID Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Invoke-WGUpgrade.md Use this to upgrade a single package by its unique identifier. Wildcards are permitted. ```powershell Invoke-WGUpgrade -id Microsoft.VC++2015-2019Redist-x64 ``` -------------------------------- ### Confirm Parameter Definition Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Configuration details for the Confirm switch parameter. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: cf Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Retrieve Winget executable path Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Get-WGPath.md Returns the full path to winget.exe. Useful when running under the System context where the executable might not be automatically located. ```powershell PS C:\> Get-WGPath C:\Users\Jeff\AppData\Local\Microsoft\WindowsApps\Winget.exe ``` -------------------------------- ### Test Winget Version (Quiet Mode) Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Test-WGVersion.md Use the -Quiet parameter with Test-WGVersion to receive a simple boolean output indicating whether an update is available. This is useful for scripting and automation. ```powershell PS C:\> Test-WGVersion -Quiet False ``` -------------------------------- ### Invoke Winget Package Upgrade Source: https://github.com/jdhitsolutions/wingettools/blob/main/en-US/about_WingetTools.help.txt Performs a silent upgrade of a specified package using its ID. Accepts all licenses and agreements automatically. Supports -WhatIf. ```powershell Invoke-WGUpgrade ``` -------------------------------- ### Passthru Parameter Definition Source: https://github.com/jdhitsolutions/wingettools/blob/main/docs/Install-WinGet.md Configuration details for the Passthru switch parameter. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.