How to Uninstall-Module of older version

Short answer:

You can't that uninstall something with PowerShellGet if it wasn't installed with PowerShellGet.

Long answer:

PowerShellGet v1.0.0.1 was installed as a part of Windows, and not using PowerShellGet (naturally). Hence, why you can't use PowerShellGet to Uninstall-Module it.

PowerShellGet v2.2 on the other hand, is installed with PowerShellGet and so you can Uninstall-Module it. You can also update it etc.

If you really want to uninstall the v1.0.0.1 version, you have to follow these Steps:

  1. Browse to C:\Program Files\WindowsPowerShell\Modules\
  2. Go into C:\Program Files\WindowsPowerShell\Modules\PowershellGet folder, and delete the sub- folder 1.0.0.1
  3. Then do the same for C:\Program Files\WindowsPowerShell\Modules\PackageManagement, delete the sub-folder 1.0.0.1

Tags:

Powershell