-
Notifications
You must be signed in to change notification settings - Fork 189
PackageProvider Interface
A OneGet PackageProvider
that is implemented in PowerShell must be written as a module that exposes functions with signatures that match the following:
Returns the name of this PackageProvider
This is required. Without this, the PackageProvider
implementation will not be recognized, and will not load.
string GetPackageProviderName()
function Get-PackageProviderName { }
As string
representing the name for this package provider. This value is exposed to the user.
If the PackageProvider
has a failure, it should throw an exception.
Adds a (or replaces an existing) package source.
Package Sources are always managed by the PackageProvider
.
This function is required if the PackageProvider
supports user-specified package sources
void AddPackageSource(string name, string location, bool trusted, bool validateLocation, Request request)
function Add-PackageSource {
param(
[string] $name,
[string] $location,
[bool] $trusted,
[bool] $validateLocation
)
}
Parameter | Type | Description |
---|---|---|
name |
string |
the name the user is giving to the package source |
location |
string |
the location that the source points to. (Uri, Filepath, or any other destination format supported by the package provider) |
trusted |
bool |
Indicates whether the user trusts packages from this source |
validateLocation |
bool |
If true, indicates the location should be validated (verified to be an actual workable location) before it is added as a source |
If a package source is added or updated, the PackageProvider
must call $request.YieldPackageSource( )
with the details regarding the package source
There is no return value from this function.
If the PackageProvider
is unable to fulfill add the source, it should throw an exception.