Devolutions / Devolutions/UniGetUI

[BUG] Upgrading a PowerShell 7 package doesn't delete the old version

Open
#5,123 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
26.1k
Forks
924
Avg merge
15h 1m
Merged PRs (30d)
55

Description

### Please confirm these before moving forward

- [x] I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
- [x] I have tested that this issue has not been fixed in the latest [(beta or stable) release](https://github.com/Devolutions/UniGetUI/releases/).
- [x] I have checked the [FAQ](https://github.com/Devolutions/UniGetUI#frequently-asked-questions) section for solutions.
- [x] This issue is about a bug (if it is not, please use the [correct template](https://github.com/Devolutions/UniGetUI/issues/new/choose)).

### UniGetUI Version

2026.2.5

### Windows version, edition, and architecture

Windows 11 Pro 10.0.26200.8875 x64

### Describe your issue

When using UniGetUI to upgrade a PowerShell 7 package, after upgrade there are both versions of the package installed: the one before update, and the one after the update.

According to the [Update-PSResource documentation](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.psresourceget/update-psresource) it is an artifact of how Update-PSResource works.

> The new version of the resource is installed side-by-side with previous versions in a new versioned folder.

> By default, Update-PSResource installs the latest version of the package and any of its dependencies without deleting the older versions installed. There is no command to uninstall older versions of a package. You must manually delete the files and folders of the older versions.

Although I think a comprehensive updater such as UniGetUI should remove the old version after installing the new one. Knowing the version number before the update, and that the update succeeded, UniGetUI can invoke `Remove-PSResource` for that specific old version to clean it up. That would be the intuitive and expected behavior.

### Steps to reproduce the issue

1. Install an older version of the package in the system:
```powershell
~ Install-PSResource -Name Devolutions.PowerShell -Confirm:$false `
-TrustRepository -AcceptLicense -Scope AllUsers -Version 2026.2.1
```
2. Confirm that it's got installed and it's the only version in the system:
```powershell
~ get-psresource -scope AllUsers | Where Name -ilike 'Devolutions*'

Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
Devolutions.PowerShell 2026.2.1 PSGallery The Devolutions.PowerShell
```
3. Start UniGetUI, or restart it if it was started previously. Sometimes UniGetUI doesn't detect older package version if it was upgraded in this same session.
4. Click "Reload" to force checking for update _[as a side note I think the term "Reload" is vastly incorrect, the button should read "Check for updates"]_.
5. The update for Devolutions.PowerShell should appear. Click "Update selection".
6. After it got updated, go to PowerShell again and check the versions in the system:
```powershell
~ get-psresource -scope AllUsers | Where Name -ilike 'Devolutions*'

Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
Devolutions.PowerShell 2026.2.2 PSGallery The Devolutions.PowerShell
Devolutions.PowerShell 2026.2.1 PSGallery The Devolutions.PowerShell
```
7. In order to remove the old version you need to do it manually:
```powershell
uninstall-PSResource devolutions.powershell -Version 2026.2.1
```

### UniGetUI Log

```text
[16.07.2026 23:31:32] __ __ _ ______ __ __ ______
/ / / /___ (_) ____/__ / /_/ / / / _/
/ / / / __ \/ / / __/ _ \/ __/ / / // /
/ /_/ / / / / / /_/ / __/ /_/ /_/ // /
\____/_/ /_/_/\____/\___/\__/\____/___/
Welcome to UniGetUI Version 2026.2.5
[16.07.2026 23:31:32]
[16.07.2026 23:31:32] Build 107
[16.07.2026 23:31:32] UI Framework: Avalonia
[16.07.2026 23:31:32] Data directory C:\Users\****\AppData\Local\UniGetUI
[16.07.2026 23:31:32] OS: Microsoft Windows 10.0.26200
[16.07.2026 23:31:32] Process arch: X64 (OS: X64)
[16.07.2026 23:31:32] Runtime: .NET 10.0.10
[16.07.2026 23:31:32] Loaded language locale: en
[16.07.2026 23:31:32] Elevated: False
[16.07.2026 23:31:32] Packaged (MSIX): False
[16.07.2026 23:31:32] Args: (none)
[16.07.2026 23:31:32] DXGI hardware GPU detection took 10,2 ms; hardware GPU: True
[16.07.2026 23:31:32] Unable to retrieve secret for resource 'UniGetUI/GitHubAccessToken': Element not found.

Cannot get credential from Vault
[16.07.2026 23:31:32] Unable to retrieve secret for resource 'UniGetUI/GitHubAccessToken': Element not found.

Cannot get credential from Vault
[16.07.2026 23:31:32] Unable to retrieve secret for resource 'UniGetUI/GitHubAccessToken': Element not found.

Cannot get credential from Vault
[16.07.2026 23:31:33] Starting Avalonia shell bootstrap
[16.07.2026 23:31:33] Loaded language locale: en
[16.07.2026 23:31:33] Generated a IPC API auth token for the current session
[16.07.2026 23:31:33] Chocolatey is not enabled
[16.07.2026 23:31:33] Scoop is not enabled
[16.07.2026 23:31:33] PowerShell is enabled and was found on C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
[16.07.2026 23:31:33] Command bun.exe was not found on the system
[16.07.2026 23:31:33] PowerShell7 is enabled and was found on C:\Program Files\PowerShell\7\pwsh.exe
[16.07.2026 23:31:33] Command vcpkg.exe was not found on the system
[16.07.2026 23:31:33] Npm is enabled and was found on C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
[16.07.2026 23:31:33] Cargo is enabled and was found on C:\Users\****\.cargo\bin\cargo.exe
[16.07.2026 23:31:33] Command bun.cmd was not found on the system
[16.07.2026 23:31:33] Bun is enabled but was not found on the system!
[16.07.2026 23:31:33] Pip is enabled and was found on C:\Users\****\AppData\Local\Programs\Python\Python314\python.EXE
[16.07.2026 23:31:33] Command vcpkg was not found on the system
[16.07.2026 23:31:33] Api running on named pipe UniGetUI.IPC
[16.07.2026 23:31:33] Command vcpkg was not found on the system
[16.07.2026 23:31:33] Vcpkg root was not found. Please define the %VCPKG_ROOT% environment variable or define it from UniGetUI Settings
[16.07.2026 23:31:33] vcpkg is enabled but was not found on the system!
[16.07.2026 23:31:33] Auto-updater source 'ProductInfo' returned version 2026.2.5.0 (upgradable=False)
[16.07.2026 23:31:33] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Cargo (aka Cargo)
█ Executable name: "cargo.exe"
█ Executable path: "C:\Users\****\.cargo\bin\cargo.exe"
█ Call arguments: ""
█ Version: cargo 1.97.0 (c980f4866 2026-06-30)

█ Cargo is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:33] Connected to WinGet API using packaged COM activation.
[16.07.2026 23:31:33] WinGet activation mode selected: packaged COM registration | Source: system COM registration
[16.07.2026 23:31:33] Winget is enabled and was found on C:\Users\****\AppData\Local\Microsoft\WindowsApps\winget.exe
[16.07.2026 23:31:33] .NET Tool is enabled and was found on C:\Program Files\dotnet\dotnet.exe
[16.07.2026 23:31:33] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: PowerShell 7.x (aka PowerShell7)
█ Executable name: "pwsh.exe"
█ Executable path: "C:\Program Files\PowerShell\7\pwsh.exe"
█ Call arguments: " -NoProfile -Command"
█ Version: PowerShell 7.6.3

█ PowerShell 7.x is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:33] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: WinGet (aka Winget)
█ Executable name: "winget.exe"
█ Executable path: "C:\Users\****\AppData\Local\Microsoft\WindowsApps\winget.exe"
█ Call arguments: ""
█ Version: System WinGet (CLI) Version: v1.29.280
█ Using Native WinGet helper (COM Api)
█ Activation mode: packaged COM registration
█ Activation source: system COM registration

█ WinGet is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:33] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: .NET Tool (aka .NET Tool)
█ Executable name: "dotnet tool"
█ Executable path: "C:\Program Files\dotnet\dotnet.exe"
█ Call arguments: "tool "
█ Version: 10.0.302

█ .NET Tool is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:34] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Pip (aka Pip)
█ Executable name: "pip"
█ Executable path: "C:\Users\****\AppData\Local\Programs\Python\Python314\python.EXE"
█ Call arguments: "-m pip "
█ Version: pip 26.1.2 from C:\Users\****\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip (python 3.14)

█ Pip is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:34] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: Npm (aka Npm)
█ Executable name: "npm"
█ Executable path: "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe"
█ Call arguments: "-NoProfile -ExecutionPolicy Bypass -Command "C:\Users\****\AppData\Roaming\npm\npm.cmd" "
█ Version: 12.0.1

█ Npm is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:34] ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█▀▀▀▀▀▀▀▀▀▀▀▀▀ MANAGER LOADED ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█ Name: PowerShell 5.x (aka PowerShell)
█ Executable name: "powershell.exe"
█ Executable path: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
█ Call arguments: " -NoProfile -Command"
█ Version: Name Value
█ ---- -----
█ PSVersion 5.1.26100.8875
█ PSEdition Desktop
█ PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
█ BuildVersion 10.0.26100.8875
█ CLRVersion 4.0.30319.42000
█ WSManStackVersion 3.0
█ PSRemotingProtocolVersion 2.3
█ SerializationVersion 1.1.0.1

█ PowerShell 5.x is enabled and ready to go.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
[16.07.2026 23:31:36] Found 0 available updates from Cargo
[16.07.2026 23:31:36] Found 4 installed packages from .NET Tool
[16.07.2026 23:31:37] Found 6 installed packages from PowerShell7
[16.07.2026 23:31:37] Found 0 available updates from .NET Tool
[16.07.2026 23:31:39] Found 2 installed packages from Cargo
[16.07.2026 23:31:40] Integrity check passed successfully!
[16.07.2026 23:31:40] Dependency cargo-update for Cargo is present.
[16.07.2026 23:31:40] Dependency cargo-binstall for Cargo is present.
[16.07.2026 23:31:40] Avalonia shell bootstrap completed
[16.07.2026 23:31:41] Found 4 installed packages from .NET Tool
[16.07.2026 23:31:41] Found 51 installed packages from Pip
[16.07.2026 23:31:41] Found 6 installed packages from PowerShell7
[16.07.2026 23:31:42] Found 3 installed packages from PowerShell
[16.07.2026 23:31:42] Found 3 installed packages from PowerShell
[16.07.2026 23:31:42] Found 0 available updates from Npm
[16.07.2026 23:31:42] Found 0 available updates from PowerShell
[16.07.2026 23:31:43] Version string 26.02 ZS v1.5.7 R1 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:43] Version string 26.02 ZS v1.5.7 R1 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:43] Version string 26.02 ZS v1.5.7 R1 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:44] Version string 1.02 DEPfix2 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:44] Version string 1.02 DEPfix2 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:44] Found 2 available updates from Winget
[16.07.2026 23:31:44] Version string 2.26 preview 2026-04-27 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:44] Version string 2.26 preview 2026-04-27 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[16.07.2026 23:31:45] Could not resolve installer hosts for mcmilk.7zip-zstd version 26.02 ZS v1.5.7 R1: Failed during source operation 'manifest' for 'winget': Version '26.02 ZS v1.5.7 R1' was not found for package 'mcmilk.7zip-zstd' in source 'winget'.
[16.07.2026 23:31:45] Found 3 installed packages from Npm
[16.07.2026 23:31:46] Found 300 installed packages from Winget
[16.07.2026 23:31:46] Found 0 available updates from Pip
[16.07.2026 23:32:03] Found 1 available updates from PowerShell7
[16.07.2026 23:32:08] Queuing UniGetUI.PackageEngine.PackageClasses.Package version 2026.2.1 for automatic uninstall after update...
[16.07.2026 23:32:08] Loaded operation parameters for package id=Devolutions.PowerShell on manager PowerShell7 and operation Update: Update-PSResource -Name Devolutions.PowerShell -Confirm:$false -Force -TrustRepository -AcceptLicense -Scope AllUsers
[16.07.2026 23:32:28] Loaded operation parameters for package id=Devolutions.PowerShell on manager PowerShell7 and operation Uninstall: Uninstall-PSResource -Name Devolutions.PowerShell -Confirm:$false -Version 2026.2.1
[16.07.2026 23:32:31] Found 7 installed packages from PowerShell7
```

### Package Managers Logs

```text
Manager WinGet with version:
System WinGet (CLI) Version: v1.29.280
Using Native WinGet helper (COM Api)
Activation mode: packaged COM registration
Activation source: system COM registration

——————————————————————————————————————————

Logged native task on manager Winget. Task type is ListSources
Process start time: 16.07.2026 23:31:33
Process end time: 16.07.2026 23:31:33

-- Task information
...

The task reported success

——————————————————————————————————————————
Logged subprocess-based task on manager Winget. Task type is RefreshIndexes
Subprocess executable: "C:\Users\****\AppData\Local\Microsoft\WindowsApps\winget.exe"
Command-line arguments: " source update --disable-interactivity "
Process start time: 16.07.2026 23:31:35
Process end time: 16.07.2026 23:31:36

-- Process STDOUT
...

Return code: SUCCESS (0)

——————————————————————————————————————————
Logged native task on manager Winget. Task type is ListUpdates
Process start time: 16.07.2026 23:31:36
Process end time: 16.07.2026 23:31:44

-- Task information
...

The task reported success

——————————————————————————————————————————
Logged native task on manager Winget. Task type is OtherTask
Process start time: 16.07.2026 23:31:36
Process end time: 16.07.2026 23:31:43

-- Task information
...

The task reported success

——————————————————————————————————————————
Logged native task on manager Winget. Task type is ListInstalledPackages
Process start time: 16.07.2026 23:31:39
Process end time: 16.07.2026 23:31:46

-- Task information
...

The task reported success

——————————————————————————————————————————
```

### Relevant information

I don't know if it's a bug or a feature request, I'll leave the decision to you.

Thanks.

### Screenshots and videos

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with UniGetUI's PowerShell 7 manager update path and reproduce the report using the documented Install-PSResource, Update-PSResource, and Remove-PSResource commands. Done means a successful update leaves the new package version installed and removes the previous version, while an unsuccessful update does not trigger cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.