PowerShellGet - Why won't it update

Fighting with trying to get the latest version of PowerShellGet on my Windows machine because I wanted to prettify my prompt

You will quickly realize the issue when you try to use an unknown parameter when installing modules i.e. AllowPrerelease

In this case I ran this command Install-Module PSReadLine -AllowPrerelease -Force

PowerShellGet 1.0.0.1 does not have this option or much of anything useful so first try to upgrade it with Update-Module PowerShellGet -Force

Hopefully that worked for you: Check it here Get-Command Install-Module

It did not work for me as it continued to keep PowershellGet 1.0.0.1.  Now do the more direct removal of this troublesome library.

  • Browse to C:\Program Files\WindowsPowerShell\Modules\
  • Open the folder C:\Program Files\WindowsPowerShell\Modules\PowershellGet and delete the subfolder 1.0.0.1
  • Open the folder C:\Program Files\WindowsPowerShell\Modules\PackageManagement and delete the subfolder 1.0.0.1
  • Browse to C:\Program Files (x86)\WindowsPowerShell\Modules\
  • Open the folder C:\Program Files (x86)\WindowsPowerShell\Modules\PowershellGet and delete the subfolder 1.0.0.1
  • Open the folder C:\Program Files (x86)\WindowsPowerShell\Modules\PackageManagement and delete the subfolder 1.0.0.1

Now run Install-Module PowerShellGet -Force and Update-Module PowerShellGet

Check the installation Get-Command Install-Module

Links that helped me solve this

Update-Module : Module ‘PowershellGet’ was not installed by using Install-Module, so it cannot be updated. - Evotec
Update-Module : Module ‘PowershellGet’ was not installed by using Install-Module, so it cannot be updated.
How to Uninstall-Module of older version
The system appears to have two (2) versions of PowerShellGet module installed. Script 2.2 PowerShellGetScript 1.0.0.1 PowerShellGet How can I uninstall the older version? The
Install-Module : A parameter cannot be found that matches parameter name ‘AllowPrerelease’ - Easy365Manager
How to fix: A parameter cannot be found that matches parameter name. Includes generic solution for any and all PowerShell commands.