How do I fix the 'PackageManagement is currently in use' error?

June 2, 2025 5 answers
Asked by oar-lock
I'm trying to run some ExchangeOnline commands, but I keep getting the error message that says "'PackageManagement' is currently in use. Retry the operation after closing the applications." I've followed a bunch of solutions from forums including using Process Explorer, uninstalling and deleting the ProgramFiles, but nothing seems to work. Has anyone else experienced this and found a solution?

Answers

chart+26
Have you tried using the `-AllowClobber` flag? If that doesn't work, I recommend rebooting your system, running the uninstall command again, rebooting, and then trying to reinstall it.

rescue dog training: I've gone through that cycle a few times and have the same results.

Reply to this answer
4round-draft
Make sure to update both PackageManagement and PowerShellGet individually. Don't forget to delete any older versions first if you have them.
Reply to this answer
mortgage amortization
It's tricky because you can't update the modules that are currently in use. You might try saving the modules locally, removing the loaded versions, and then importing them back. It's a workaround that has worked for me to install updated modules in the proper locations.
Reply to this answer
geranium
I ran into this issue a couple of weeks ago as well. I had multiple versions of the PackageManagement module installed. What I did was copy one version to my desktop, delete all the modules, and then install only the latest version. Don't forget to update PowerShellGet while you're at it!
Reply to this answer
sprint+rest+repeat
Why aren't you using `Install-PSResource`? Itโ€™s not as well known but it's supposed to be a better option for handling these types of installations.

chart+26: Because itโ€™s not well publicized and isnโ€™t listed as a dependency for Exchange Online, I didn't consider it.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions