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
22.5k stars 1.39k forks source link

winget configuratoin validate succeeds without error despite resource not existing #4509

Open mattmazzola opened 1 month ago

mattmazzola commented 1 month ago

Brief description of your issue

I was testing the winget configuration validation and intentionally supplied a bad resource name by adding a 'Z' at the end of name expected it to fail.

-    - resource: Microsoft.Windows.Developer/ShowSecondsInClock
+    - resource: Microsoft.Windows.Developer/ShowSecondsInClockZ

However, the CLI still output

Validation found no issues.

This makes me think there is something that implicitly skips unrecognized resources.

Steps to reproduce

See logs

Run validation command such as

winget configuration validate -f .\configurations\settings.dsc.yaml

Expected behavior

Winget should report that the resource Microsoft.Windows.Developer/ShowSecondsInClockZ does not exist and suggest likely names Microsoft.Windows.Developer/ShowSecondsInClock

Actual behavior

winget reports

Validation found no issues.

Environment

Winget: v1.7.11261
Windows: v10.0.022621.3593