PowerShell PackageManagement, how to uninstall a package provider? PowerShell PackageManagement, how to uninstall a package provider? powershell powershell

PowerShell PackageManagement, how to uninstall a package provider?


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-locationshttps://github.com/OneGet/oneget/wiki/ImplementingPackageProvider


A simple example of how to remove NuGet provider

(Get-PackageProvider|where-object{$_.name -eq "nuget"}).ProviderPath|Remove-Item -forceRestart-Computer


If I understand what you want :

Uninstall-Package [-Id] [-RemoveDependencies] [-ProjectName ] [-Force] [-Version ] [-WhatIf]

Use the -Force option to forces a package to be uninstalled.