If you are seeing the Winget error:
“The
msstoresource requires that you view the following agreements before using.”
I will show you four proven fixes that resolve this error on Windows Server and Windows 10/11.
This issue affects:
- Windows Server 2019
- Windows Server 2022
- Fresh Windows installations
- Automated builds (Ansible, Packer, Azure Image Builder, SCCM, Intune, etc.)
- Any system where Winget has never been initialized
Let’s dive into what causes this error and how you can fix it permanently.
Full Winget Error (Reference)
Here is the full text of the error users typically encounter:
Failed in attempting to update the source: winget
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:
An unexpected error occurred while executing the command:
0x8a150042 : Error reading input in prompt
Why This Winget Error Happens
This Winget error is triggered when:
1. The Microsoft Store (msstore) source is enabled
But Winget has never been initialized for the current user or system.
2. Winget needs you to accept a license agreement
But automated tools (Ansible, Packer, WinRM, scripts) cannot press Y, so Winget fails.
3. The system has no geographic region set
Winget requires a 2-letter region code (e.g., US, AU, GB).
4. On Windows Server, the Microsoft Store does not exist
So Winget’s msstore source can never complete initialization.
5. Winget cannot prompt for input in non-interactive environments
Automation = no keyboard input → Winget errors out.
Solution 1: Install Winget Sources Manually (Fixes Broken msstore)
The fastest fix is to manually install the source package so Winget does not need to prompt:
Add-AppPackage -path "https://cdn.winget.microsoft.com/cache/source.msix"
This installs the required Winget source bundle without prompting for license acceptance.
Solution 2: Install packages from the Winget source only
Skip the Microsoft Store entirely and install packages directly from the Winget repository:
winget install -e --scope machine Google.Chrome --accept-package-agreements --accept-source-agreements --source winget
This bypasses the Microsoft Store (msstore) source and prevents any prompts.
This is the best approach for:
- Windows Server
- CI/CD systems
- Automation (Ansible, Packer, Terraform, etc.)
- Scripted installations
Solution 3: Remove the msstore source completely
Since Windows Server cannot use the Microsoft Store, the best fix is to simply remove it:
winget source remove msstore
winget source reset --force
After this, Winget will use only:
winget(the public repository)- any custom sources you add
Packages like Chrome, Git, VSCode, Node.js, Python, etc. do not require msstore.
Solution 4: Initialize Winget interactively (manual method)
If this is a desktop system or automation is not required, simply run:
winget install <package>
The first time you run Winget:
- it will show the license agreements
- you press Y to accept
- your acceptance is stored permanently
- all future winget commands work
This is the simplest method for normal desktop users.
Which Solution Should You Use?
| Environment | Recommended Fix |
|---|---|
| Windows Server 2022/2019 | Remove msstore (Solution 3) |
| CI/CD / DevOps automation (Ansible, Packer, AIB, SCCM) | Solution 2 or 3 |
| Developer workstation | Solution 4 |
| Systems with corrupted Winget sources | Solution 1 + 3 |
What Causes “0x8a150042 : Error reading input in prompt”?
This error means:
Winget tried to display a prompt, but the environment is non-interactive.
This occurs with:
- Ansible (WinRM)
- Packer
- Azure DevOps runners
- PowerShell remoting
- Windows Server Core
- Scheduled tasks
- ExecutionPolicy bypass runs
Winget expects someone to press Y, but no input is allowed → immediate failure.
Conclusion
The Winget error:
“The
msstoresource requires that you view the following agreements before using.”
is annoying but entirely fixable.
You can fix it by:
- installing the Winget source package
- installing apps from the Winget repo only
- removing the msstore source
- or initializing Winget interactively
Once done, Winget works perfectly on both Windows Server and Windows 10/11.
