microsoft / microsoft/winget-cli

Winget Install Issue Via EnterPSSession

Open
#2,647 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

Greeting Winget Team and other Tech folks!

I was exploring Winget and had an issue similar to issue #715 except I was remoting from my PC into a Target PC.

The first remote install and uninstall of Microsoft.Office was fine (see steps below) but trying to reinstall it remotely gave Installer hash does not match; this cannot be overridden when running as admin. I tried it in Terminal and just straight up PS7. Much like [#715] I also tried --Force and it was no better.

I physically logged into the PC I was trying to install Microsoft.Office on again and ran PS7 administratively and was able to install Microsoft.Office again via winget install --id Microsoft.Office --accept-source-agreements --Scope Machine

I was combing over past issue and [#715] and its merge into winget-pkgs pull request #83280.

I don't have much GPO experience but did the --force ever get rolled into the settings .json?

I also seem to remember seeing a settings change via the Winget Settings.json to add or make sure it was running administratively but can't seem to find it. Does anyone have a link to that?

Look forward to hearing from you,

Steps to reproduce
  1. Start PowerShell 7 or Terminal PS7 ran as admin.
  2. Type Enter-PSSession -ComputerName PC-123 -Credential User@doamin.com.
  3. Run winget CMD winget install --id Microsoft.Office --accept-source-agreements --Scope Machine.
  4. Once installed, uninstall with winget uninstall --id Microsoft.Office
  5. Reinstall it again with the same as step 3.
Expected behavior
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://officecdn.microsoft.com/pr/wsus/setup.exe
  ██████████████████████████████  7.13 MB / 7.13 MB
Successfully verified installer hash
Starting package install...
Successfully installed```

### Actual behavior

  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 4.87 MB
  ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 4.87 MB
  ██████████████████▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 4.87 MB
  ████████████████████████▒▒▒▒▒▒  4.00 MB / 4.87 MB
  ██████████████████████████████  4.87 MB / 4.87 MB


  â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’  0%
  â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’  0%

Found Microsoft 365 Apps for enterprise [Microsoft.Office] Version 16.0.15427.20210
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://officecdn.microsoft.com/pr/wsus/setup.exe


  â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’  0.00 B / 7.13 MB
  ██████████████████████████████  7.13 MB / 7.13 MB
Installer hash does not match; this cannot be overridden when running as admin

### Environment

```shell
My Machine:

   OS: Win 10 Pro 64 Bit 21H2 (19044.2130)

   PowerShell: 7.2.7

   MS Terminal: 1.15.2874.0

   Windows Package Manager: v1.3.2691

   User Acct: Domain Profile w/ Admin

   UAC Settings: Default

Target Machine:

   OS: Win 10 Pro 64 Bit 21H2 (19044.2130)

   PowerShell: 7.2.7

   Windows Package Manager: v1.3.2691

   User Acct: Domain Profile w/ Admin

   UAC Settings: Default

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported winget install --id Microsoft.Office --accept-source-agreements --Scope Machine sequence inside Enter-PSSession, including the uninstall and reinstall. The issue names no source file or test; trace the installer-hash verification path for administrative remote installs and add coverage for the observed second-install behavior. Done means the documented scenario has a clear, verified result without weakening hash validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.