-
Notifications
You must be signed in to change notification settings - Fork 189
PackageManagementService
public class PackageManagementService {
public IEnumerable<string> ProviderNames{get;}
public IEnumerable<PackageProvider> PackageProviders {get;}
public IEnumerable<PackageProvider> SelectProviders(string providerName, IHostApi requestObject);
public IEnumerable<PackageProvider> SelectProvidersWithFeature(string featureString);
}
PowerShell Example
# special case: make sure that nuget is bootstrapped automagically
$request.PackageManagementService.SelectProvider("NuGet");
$providers = $request.PackageManagementService.SelectProvidersWithFeature( "supports-powershell-modules");
for-eachObject $providers {
packages = $_.FindPackages( ... );
for-eachObject $providers {
Write-Out $_
}
}
Returns a collection with the names of all the registered PackageProvider
instances.
An IEnumerable<string>
with the names of all the registered PackageProvider
instances.
Not expected to throw exceptions.
Returns a collection with the instances of all the registered PackageProvider
s.
An IEnumerable<PackageProvider>
with all the registered PackageProvider
instances.
Not expected to throw exceptions.
Returns a collection of PackageProvider
instances that matches the given providerName and sources.
IEnumerable<PackageProvider> SelectProvidersBySource(string providerName, IEnumerable<string> sources)
Returns a collection of PackageProvider
instances that matches the given providerName and sources.
If there are no matches found given the critetria, an empty collection is returned.
Not expected to throw an exception.
Returns a collection of PackageProvider
instances that all report implementing a given feature.
IEnumerable<PackageProvider> SelectProvidersByFeature(string feature)
Returns a collection of PackageProvider
instances that matches the given providerName and sources.
If there are no matches found given the critetria, an empty collection is returned.
Not expected to throw an exception.