Open nickrandolph opened 1 year ago
Here is an example:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# Reference: https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install PowerToys from the Microsoft Store
allowPrerelease: true
settings:
id: XP89DCGQ3K6VLD
source: msstore
configurationVersion: 0.2.0
@denelon I've been trying to install MS Store apps as well, and looking at your example, I couldn't figure out why it wasn't working for these two packages, because it definitely looks like I've been doing it correctly.
# Windows Terminal
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: WindowsTerminal
directives:
description: Install Windows Terminal
allowPrerelease: true
settings:
id: 9N0DX20HK701
source: msstore
# DevToys
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: DevToys
directives:
description: Install DevToys
allowPrerelease: true
settings:
id: 9PGCV4V3BK4W
source: msstore
So I decided to try the PowerToys example and it did work, so something isn't quite working as expected. Seems like it can't find the package: 'No packages matched the given input criteria.'
Here is the full output from one of the log files:
2023-09-30 13:21:05.247 [CORE] WinGet, version [1.7.2722-preview], activity [{4E11D8AC-D276-4C71-AB56-B749C15AB08E}]
2023-09-30 13:21:05.247 [CORE] OS: Windows.Desktop v10.0.19044.3448
2023-09-30 13:21:05.247 [CORE] Command line Args: "winget" configure -f .\.configurations\configuration.dsc.yaml
2023-09-30 13:21:05.247 [CORE] Package: Microsoft.DesktopAppInstaller v1.22.2722.0
2023-09-30 13:21:05.247 [CORE] IsCOMCall:0; Caller: winget-cli
2023-09-30 13:21:05.269 [CLI ] WinGet invoked with arguments: 'configure' '-f' '.\.configurations\configuration.dsc.yaml'
2023-09-30 13:21:05.270 [CLI ] Found subcommand: configure
2023-09-30 13:21:05.270 [CLI ] Leaf command to execute: root:configure
2023-09-30 13:21:05.270 [CLI ] Executing command: configure
2023-09-30 13:21:26.930 [CONF] Configuration unit WinGetPackage[WindowsTerminal] failed with code 0x8a15c106 and error message:
No packages matched the given input criteria.
Microsoft.Management.Configuration.Processor.Exceptions.InvokeDscResourceException: Failed when calling `Set` for resource: WinGetPackage [Microsoft.WinGet.DSC] Message: 'No packages matched the given input criteria.
'
at Microsoft.Management.Configuration.Processor.DscModule.DscModuleV2.InvokeSetResource(PowerShell pwsh, ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Runspaces.HostedEnvironment.InvokeSetResource(ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Unit.ConfigurationUnitProcessor.ApplySettings()
2023-09-30 13:21:29.615 [CONF] Configuration unit WinGetPackage[DevToys] failed with code 0x8a15c106 and error message:
No packages matched the given input criteria.
Microsoft.Management.Configuration.Processor.Exceptions.InvokeDscResourceException: Failed when calling `Set` for resource: WinGetPackage [Microsoft.WinGet.DSC] Message: 'No packages matched the given input criteria.
'
at Microsoft.Management.Configuration.Processor.DscModule.DscModuleV2.InvokeSetResource(PowerShell pwsh, ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Runspaces.HostedEnvironment.InvokeSetResource(ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Unit.ConfigurationUnitProcessor.ApplySettings()
2023-09-30 13:21:45.568 [CLI ] Terminating context: 0x8a15c005 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\ConfigurationFlow.cpp:3f1
Here is an example:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 # Reference: https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md properties: resources: - resource: Microsoft.WinGet.DSC/WinGetPackage directives: description: Install PowerToys from the Microsoft Store allowPrerelease: true settings: id: XP89DCGQ3K6VLD source: msstore configurationVersion: 0.2.0
I did encounter an error with the Windows Terminal example via the msstore source. I'm trying to isolate what might be causing this so we can file a but on it.
We've isolated the issue with this one. It's a bug. The workaround is to put the value for the "id:" in quotes.
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# Reference: https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: WindowsTerminal
directives:
description: Install Windows Terminal
allowPrerelease: true
settings:
id: "9N0DX20HK701"
source: msstore
configurationVersion: 0.2.0
We've isolated the issue with this one. It's a bug. The workaround is to put the value for the "id:" in quotes.
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 # Reference: https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md properties: resources: - resource: Microsoft.WinGet.DSC/WinGetPackage id: WindowsTerminal directives: description: Install Windows Terminal allowPrerelease: true settings: id: "9N0DX20HK701" source: msstore configurationVersion: 0.2.0
Confirmed that this workaround indeed works. Thank you!
Brief description of your issue
Please provide an example of how to specify an app from the msstore via a winget configuration file