winget prompts on first time use
Brief description of your issue
I have used winget in the Windows Sandbox. I'm not sure if this is a documentation issue or a bug. Or both.
The winget command prompts for input on first use. That is not good since I see winget as something that our users will run in the background to install apps.
winget search rayvn
The `msstore` source requires that you view the following agreements before using.
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
The source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US").
Do you agree to all the source agreements terms?
[Y] Yes [N] No: y
No package found matching input criteria.
It is important to us that there is no prompting since our users are unlikely to see winget in action.
WinGet ships with two default sources - winget (the Community repository) & msstore (Microsoft Store). WinGet here is asking you to accept Microsoft Store's terms & conditions
You can either pass the --accept-source-agreements argument the first time you use WinGet or if you don't want the store source at all you can also remove it via the winget source command
Thanks! That helped.
I am a disappointed that it is not mentioned in the list of parameters.
--accept-source-agreements only worked at the end of the command line.
If you're doing an automated solution, I'd suggest using the PowerShell module (or implementing against the COM APIs) as it's going to be a bit friendlier than trying to parse the strings coming out of WinGet.
I'm only using PowerShell to install winget. We will be looking into using winget to pre-install software for the users.
Will you be leveraging a WinGet Configuration file, or are you planning on scripting a series of Install-WinGetPackage cmdlet calls?
My plan is to install both WinGet and PSWindowsUPdate at the same time. They both have the same PowerShell configuration requirements.
PS C:\WINDOWS\system32> winget --accept-source-agreements
Windows Package Manager v1.11.400
Copyright (c) Microsoft Corporation. All rights reserved.
Argument name was not recognized for the current command: '--accept-source-agreements'
It looks like it neither accepts "Y", "yes", nor "Yes" as a response to the prompt. Nor does this command line switch appear to accept. Microsoft really have a knack of taking working things and making them diabolically broken.
PS C:\WINDOWS\system32> winget --accept-source-agreements Windows Package Manager v1.11.400 Copyright (c) Microsoft Corporation. All rights reserved. Argument name was not recognized for the current command: '--accept-source-agreements'It looks like it neither accepts "Y", "yes", nor "Yes" as a response to the prompt. Nor does this command line switch appear to accept. Microsoft really have a knack of taking working things and making them diabolically broken.
same here as of today, did you got it worked out as PS doesnt give any yes or no option:
Im using this command winget install .\setup_4.x --accept-package-agreements