microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.17k stars 1.45k forks source link

Show links in `winget list` command #3043

Open ascarter opened 1 year ago

ascarter commented 1 year ago

Description of the new feature / enhancement

For portable apps, it would be good to show the symlinks created by a package in the list command. Alternately, a winget links command that shows the link name and target.

Proposed technical implementation details

Example powershell function:

function Get-WinGetLinks {
    <#
        .SYNOPSIS
            List winget links
    #>
    [CmdletBinding()]
    [Alias("wglinks")]
    param ()

    $linksPath = Join-Path $Env:LOCALAPPDATA -ChildPath Microsoft\WinGet\Links
    Get-ChildItem -Path $linksPath | Where-Object -Property LinkType -eq -Value "SymbolicLink" | Format-Table -Property Name, LinkTarget
}
Trenly commented 1 year ago

[Policy] Area-Output