Open o-l-a-v opened 1 month ago
In the context of winget configure
command, the winget settings file is not a valid WinGet Configuration file. You can find WinGet configuration samples over at https://aka.ms/dsc.yaml.
An example configuration file to set WinGet user settings would be:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetUserSettings
directives:
description: Set WinGet user settings
allowPrerelease: true
settings:
Settings:
network:
downloader: do
visual:
progressBar: rainbow
$schema: https://aka.ms/winget-settings.schema.json
configurationVersion: 0.2.0
Thanks for the info @mdanish-kh. I was looking for info regarding whether the PowerShell module Microsoft.WinGet.Client
also requires --accept-source-agreements
and --accept-package-agreements
on a fresh system, but found no such info or input parameters for Install-WinGetPackage
. Which lead me to *-WinGetConfiguration
cmdlets.
Found this now:
Maybe it's not dealt with yet. This is alpha/beta after all?
There is a -Confirm
parameter for Install-WinGetPackage
but I am not sure if its usage is the same as what you're looking for.
This is alpha/beta after all?
Yes, for now the PowerShell module is intended to be treated as pre-release as written in its description, which is probably why there aren't solid docs for it yet. You would be better off installing the latest version of the module and then running Get-Help <cmdlet>
to see all supported options
[comment]: <[Policy] PowerShell> [comment]: <[Policy] Issue-Docs>
Brief description of your issue
Microsoft.WinGet.Configuration
v1.8.1911-alpha: https://www.powershellgallery.com/packages/Microsoft.WinGet.Configuration/1.8.1911-alphawinget config
to find path to the config file.Get-WinGetConfiguration -File 'C:\Users\olavb\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json'
fails with:Get-WinGetConfiguration: Failed to open configuration set at C:\Users\olavb\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json with error 0x8A15C002 The configuration file is invalid. See line 5, column 16 in the file.
Steps to reproduce
See description
Expected behavior
Should be able to read a default WinGet config file. Could it be due to JSON with comments?
Actual behavior
Fails.
Environment