Closed peppekerstens closed 3 years ago
Found likely cause; I installed previous versions of the modules with install-package instead of install-module. PowerShell modules do not get registered correctly by install-package
PowerShell already provides some hints;
C:\temp> Update-Module -Name GenericFunctions -Credential $PSGetCred
Update-Module: Module 'GenericFunctions' was not installed by using Install-Module, so it cannot be updated.
When I delete a previous version of the module and re-install that version, using install-module, everything works as expected;
C:\temp> Install-Module -Name GenericFunctions -Credential $PSGetCred -Scope CurrentUser -Repository psgalleryiton -Force -RequiredVersion '1.15.1'
C:\temp> Update-Module -Name GenericFunctions -Credential $PSGetCred -force
[no error/no output/updated module to latest]
C:\temp> Update-Module -Name GenericFunctions -Credential $PSGetCred -force
[no error/no output/same latest module]
So this is a very specific use-case. Don't bother...
Scenario
I am trying to update several modules from a private repository, maintained within Azure Devops. The method used is exactly as described here
I want to 'force update if exist'. So, by using -Force.
This issue only happens when trying to update from an authenticated source and using -Force. This works fine:
I have double checked access/validity of PAT key; this is not the issue
Steps to reproduce
Expected behavior
Actual behavior
PS 5
"Toegang tot het cloudbestand is geweigerd" \<translated> "Access denied to cloud file"
PS 7
Environment data
PS 5
PS 7