Skip to content

PackageProvider Instance

Garrett Serack edited this page May 19, 2014 · 5 revisions

PackageProvider Instance class

The PackageProvider Instance is returned from a call to the [PackageManagementService] .

public class PackageProvider {

    public IEnumerable<PackageSource> GetPackageSources(Callback c);
	public void AddPackageSource(string name, string location, bool trusted, Callback c);
	public void RemovePackageSource(string name, Callback c);
	public bool IsValidPackageSource(string packageSource, Callback c);
	public bool IsTrustedPackageSource(string packageSource, Callback c);

	public IEnumerable<SoftwareIdentity> FindPackage(string name, string requiredVersion, string minimumVersion, string maximumVersion, int id, Callback c);
 	public IEnumerable<SoftwareIdentity> FindPackageByUri(Uri u, int id, Callback c);
	public IEnumerable<SoftwareIdentity> FindPackageByFile(string filename, int id, Callback c);

	public IEnumerable<SoftwareIdentity> FindPackages(string[] names, string requiredVersion, string minimumVersion, string maximumVersion, Callback c);
 	public IEnumerable<SoftwareIdentity> FindPackageByUris(Uri[] uris, Callback c);
	public IEnumerable<SoftwareIdentity> FindPackageByFiles(string[] filenames,  Callback c);
	
	public int StartFind(Callback c);
	public IEnumerable<SoftwareIdentity> EndFind(int id, Callback c);

	public IEnumerable<SoftwareIdentity> GetPackageDependencies(string fastPath, Callback c);
	public IEnumerable<SoftwareIdentity> GetInstalledPackages(string name, Callback c);

	public IEnumerable<SoftwareIdentity> InstallPackage(SoftwareIdentity softwareIdentity, Callback c);
	public IEnumerable<SoftwareIdentity> UninstallPackage(SoftwareIdentity softwareIdentity, Callback c);
	public bool DownloadPackage(SoftwareIdentity softwareIdentity, string location, Callback c);
	

	public IEnumerable<OptionDefinition> GetDynamicOptions(OptionCategory operation, Callback c);
	public IEnumerable<string> Features {get;}
	
    public IEnumerable<string> SupportedUriSchemes { get; }
    public IEnumerable<string> SupportedFileExtensions{ get; } 


	public bool IsMethodSupported(PackageProviderApi api);
}

PowerShell consumers should pass the $request object as the value for the callback parameter.

Property Type Description
`` `` .