3.0.12-beta | Update-PSResource reinstalls modules installed by pre v3 PowerShellGet, even though there is no new version
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
Steps to reproduce
Option one
Import-Module -Name 'PowerShellGet' -RequiredVersion '3.0.12'
Update-PSResource -Scope 'AllUsers' -Repository 'PSGallery' -Verbose
Option two
# Install a module with PowerShellGet v2.2.5
Import-Module -Name 'PowerShellGet' -RequiredVersion '2.2.5'
Uninstall-Module -Name 'AzureRM.LogicApp' -AllVersions
Install-Module -Name 'AzureRM.LogicApp' -Scope 'AllUsers' -Repository 'PSGallery' -Force
# Check if PowerShellGet v2.2.5 will update it.
# It righfully returns that no update is available.
Update-Module -Name 'AzureRM.LogicApp' -Scope 'AllUsers' -Verbose
# Import PowerShellGet v3.0.12-beta
Remove-Module -Name 'PackageManagement','PowerShellGet','PSReadline' -Force
Import-Module -Name 'PowerShellGet' -RequiredVersion '3.0.12'
# Check if PowerShellGet v3.0.12-beta will update the module in question, once.
# Installs AzureRM.LogicApp _and_ AzureRM.Profile, same versions that are already installed.
Update-PSResource -Name 'AzureRM.LogicApp' -Scope 'AllUsers' -Verbose #
# Check if PowerShellGet v3.0.12-beta will update the module in question, twice.
# It righfully returns that no update is available.
Update-PSResource -Name 'AzureRM.LogicApp' -Scope 'AllUsers' -Verbose # Says no update available
Expected behavior
Only modules and scripts where a newer version is available on PSGallery should be updated.
Actual behavior
Seems PowerShellGet v3 reinstalls modules installed by PowerShellGet v2, not caring if there is actually a newer version?
Error details
There is no error.
Environment data
* PowerShellGet v3.0.12-beta
* Windows 10 21H2 / 19044.1586
* Windows PowerShell 5.1 terminal
Visuals
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cannot Use Newer Version of PowerShellGet in ...
I need to install the prerelease commands for MgGraph. To do that I need to use the -allowprerelease parameter for Install-Module , which...
Read more >Unable to update PowerShellGet , error: The version '1.4.7' ...
I was able to fix this by running the command below in an admin PowerShell: Update-Module -Name PowerShellGet -RequiredVersion 2.2.5.1.
Read more >PowerShellGet 3.0.12-beta
Version Downloads Last updated
3.0.21‑beta21 10,432 2 months ago
3.0.20‑beta20 6,387 4 months ago
3.0.19‑beta19 57,765 6 months ago
Read more >What is PowerShellGet and How to Install PowerShellGet 3.0
PowerShellGet is a PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like ...
Read more >[3.0.0-beta10] Install-Module fails with OneDrive - Access ...
Repo steps: Install PowerShellGet 2.2.5; Run Install-Module <any module>; Receive error PackageManagement\Install-Package : Access ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @o-l-a-v we were able to reproduce this and digging in a bit it seems like it might be a scoping issue specific to AllUsers…we’ve added this to the project we are working on now
I’ve made no modifications to that variable, nor do I use a custom profile.
The OneDrive folder is because of OneDrive for Business Known Folder Move. There are no modules installed to that folder.