PackageRequest

Namespace: AnyPackage.Provider

The PackageRequest class is used to send information to the package provider.

public sealed class PackageRequest : Request

Inheritance ObjectRequestPackageRequest

Properties

Name

Gets the package name.

public string Name { get; internal set; }

Property Value

String

Version

Gets the package version range.

public PackageVersionRange Version { get; internal set; }

Property Value

PackageVersionRange

Source

Gets the package source name.

public string Source { get; internal set; }

Property Value

String

Prerelease

Gets if should include prerelease versions.

public bool Prerelease { get; internal set; }

Property Value

Boolean

Package

Gets the package if passed in via InputObject parameter.

public PackageInfo Package { get; internal set; }

Property Value

PackageInfo

Path

Gets the path parameter.

public string Path { get; internal set; }

Property Value

String

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

Object

ParameterSetName

Gets the parameter set name.

public string ParameterSetName { get; }

Property Value

String

Stopping

Gets if the package provider has been requested to stop.

public bool Stopping { get; }

Property Value

Boolean

ProviderInfo

Gets the package provider information.

public PackageProviderInfo ProviderInfo { get; internal set; }

Property Value

PackageProviderInfo

Methods

IsMatch(String)

Checks if the name satisfies the request.

public bool IsMatch(string name)

Parameters

name String
Specifies the name.

Returns

Boolean

        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

Boolean

        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

Boolean

        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

Boolean

        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.