PackageRequest
Namespace: AnyPackage.Provider
The PackageRequest
class is used to send information to the package provider.
public sealed class PackageRequest : Request
Inheritance Object → Request → PackageRequest
Properties
Name
Gets the package name.
public string Name { get; internal set; }
Property Value
Version
Gets the package version range.
public PackageVersionRange Version { get; internal set; }
Property Value
Source
Gets the package source name.
public string Source { get; internal set; }
Property Value
Prerelease
Gets if should include prerelease versions.
public bool Prerelease { get; internal set; }
Property Value
Package
Gets the package if passed in via InputObject
parameter.
public PackageInfo Package { get; internal set; }
Property Value
Path
Gets the path parameter.
public string Path { get; internal set; }
Property Value
Uri
Gets Uri parameter.
public Uri Uri { get; internal set; }
Property Value
Uri
DynamicParameters
Gets the package provider dynamic parameters.
public object DynamicParameters { get; internal set; }
Property Value
ParameterSetName
Gets the parameter set name.
public string ParameterSetName { get; }
Property Value
Stopping
Gets if the package provider has been requested to stop.
public bool Stopping { get; }
Property Value
ProviderInfo
Gets the package provider information.
public PackageProviderInfo ProviderInfo { get; internal set; }
Property Value
Methods
IsMatch(String)
Checks if the name satisfies the request.
public bool IsMatch(string name)
Parameters
name
String
Specifies the name.
Returns
Returns true if the name is a wildcard match to the request.
Remarks:
Case is ignored during comparison.
IsMatch(PackageVersion)
Checks if the version satisfies the request.
public bool IsMatch(PackageVersion version)
Parameters
version
PackageVersion
Specifies the version.
Returns
Returns true if the version satisfies the version range requirements.
IsMatch(String, PackageVersion)
Checks if the package name and version satisfies the request.
public bool IsMatch(string name, PackageVersion version)
Parameters
name
String
Specifies the name.
version
PackageVersion
Specifies the version.
Returns
Returns true if the name and version satisfies the request.
PromptUntrustedSource(String)
Prompts the user if they want to install a package from an untrusted source.
public bool PromptUntrustedSource(string source)
Parameters
source
String
Source name.
Returns
Returns true if the user accepted or false if the user rejected.
WritePackage(PackageInfo)
Writes the package to the pipeline.
public void WritePackage(PackageInfo package)
Parameters
package
PackageInfo
The package.