Skip to content

"winget search" terms beginning with dashes are incorrectedly treated as parameters, even if wrapped in quotation marks. #6269

@DandelionSprout

Description

@DandelionSprout

Relevant area(s)

WinGet CLI

Relevant command(s)

winget search

Brief description of your issue

Sporadically, but certainly more often than never, I've found myself in situations where I've wanted to search through Winget packages with search terms that start with a dash (-).

However, Winget always treat that as if it was a parameter, making it either impossible or unintuitive to search with search terms that start with dashes.

Screenshot: Image

Steps to reproduce

  1. Open PowerShell 7.6.2 in Windows Terminal.
  2. Run winget search "-a"
  3. Receive the error "Argument alias was not recognized for the current command: '-a'"
  4. Just to be truly sure there are no obvious solutions to it, run winget search \-a with a backslash.
  5. See that it finds no results.

Expected behavior

That it is possible to use winget search with search terms that start with a dash, so that e.g. running winget search "-l" would have found D-Link packages.

Actual behavior

That all search terms that start with dashes are instead interpreted as if they were parameters.

Environment

Windows Package Manager (Preview) v1.29.170-preview
© 2026 Microsoft. All rights reserved.

Windows: Windows.Desktop v10.0.26200.8246
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.29.170.0

WinGet Directories
-------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOu…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settin…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale


Group Policy                               State
--------------------------------------------------
Enable Windows App Installer Hash Override Enabled

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Enabled
LocalArchiveMalwareScanOverride           Enabled
ProxyCommandLineOptions                   Disabled
ConfigurationProcessorPath                Disabled
DefaultProxy                              Disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-SearchIssue related to WinGet SearchIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-AttentionIssue needs attention from Microsoft

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions