Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell PackageManagement, how to uninstall a package provider?

Tags:

To troubleshoot a problem, I thought I'd try reinstalling the Chocolatey package provider. There appears to be no cmdlet to remove or uninstall a package provider. I'm not referring to removing a package source or package. I'm using PowerShell 5 on Windows 10.

Is there a way to uninstall a package provider?

like image 575
Vimes Avatar asked Sep 10 '15 17:09

Vimes


1 Answers

Package providers are bundled with the WMF installation.

You can easily add package providers (and remove) if you know the search locations (even your own custom package providers).

Find where your package-provider is installed:

$p = (Get-packageProvider -name Chocolatey);
$p.ProviderPath

If you remove / move the assembly to somewhere outside the providers default search path; it will be unavailable (NB: Restart your host too see the effects).

Similarly can you add package providers by copying a exe / dll that implements the specifications for a packageprovider to the search location.

More documentation can be found here (implementing your own and the default search locations):

https://github.com/OneGet/oneget/wiki/Provider-assembly-search-locations https://github.com/OneGet/oneget/wiki/ImplementingPackageProvider

like image 127
Harald F. Avatar answered Oct 31 '22 17:10

Harald F.