-
Notifications
You must be signed in to change notification settings - Fork 137
Unable to Install-Module 'PowerShellGet' from an Azure DevOps build pipeline #663
Comments
@santanor thanks for outlining your issue here! Would you be able to provide a little more information on the environment you are using? Specifically, the version of PowerShell, you can run |
Also do you mind running Is there a particular reason you need to install PackageManagement 1.4.3? You also do not need to install PackageManagemnt because PowerShellGet installs it. This might be causing your issue because you are installing a lower version of PackageManagement than what is required on PowerShellGet (PackageManagment 1.4.7). |
Hi @StevenBucher98, the environment is defined here Running
I'm not sure, I inherited this script so I'm cautious about making changes. Didn't know I didn't need it. So I removed the explicit installation of It failed with the following output (Sorry, it's quite long)
It has failed because getting the version with Let me know if you need any more info |
Thanks @santanor for the outputs! Do you mind confirming that PowerShellGet 2.2.5 has been installed by running If you do see it in the list then you can try importing that specific version into your PS Session by running Then try |
Also the |
Hi @StevenBucher98 - I've been following up on this today while @santanor is busy elsewhere.
This now generates the following output:
I hope this helps. Also note my Powershell-fu is weak; please answer as if to a five-year-old :) |
Thanks @pjbrown, sort of a shot in the dark but if you are able to maybe upgrade to PowerShellGet v1.6.7 by using this command, To confirm its install: and then import the module with Then do the exact same steps but replace |
So I'm running a build pipeline in Azure DevOps and one of the steps requires to install various packages, some from PSGallery and some from an internal feed. In order to do that the first thing I do is:
After that I should be able to install the remaining packages.
The problem is that sometimes,
PowerShellGet
updates and sometimes it doesn't. Which makes it a pain to debug and determine what works and what doesn't.I know a bug report should have a deterministic repro step process, but I don't have one. Sometimes it fails and sometimes it doesn't.
I have seen this fail in the past and I've resolved it by simply opening a new PowerShell instance, but that's not possible (Or at least I don't know how to do it) in an Azure DevOps build pipeline.
Steps to reproduce
if it fails, it fails with the following warning:
Expected behavior
After running the install the following code should output "2.2.5" as the version
Actual behavior
Sometimes it outputs
2.2.5
and sometimes1.0.0.1
. Which means it has failed to update.The text was updated successfully, but these errors were encountered: