다음을 통해 공유


ModuleSpecification Class

Definition

Represents module specification written in a module manifest (i.e. in RequiredModules member/field).

Module manifest allows 2 forms of module specification:

  1. string - module name
  2. hashtable - [string]ModuleName (required) + [Version]ModuleVersion/RequiredVersion (required) + [Guid]GUID (optional)

so we have a constructor that takes a string and a constructor that takes a hashtable (so that LanguagePrimitives.ConvertTo can cast a string or a hashtable to this type)

public ref class ModuleSpecification
[Windows::Foundation::Metadata::WebHostHidden]
class ModuleSpecification
public class ModuleSpecification
type ModuleSpecification = class
Public Class ModuleSpecification
Inheritance
ModuleSpecification

Constructors

ModuleSpecification()

Default constructor.

ModuleSpecification(Hashtable)

Construct a module specification from a hashtable. Keys can be ModuleName, ModuleVersion, and Guid. ModuleName must be convertible to String. ModuleVersion must be convertible to Version. Guid must be convertible to Guid.

ModuleSpecification(String)

Construct a module specification from the module name.

Properties

Guid

The module GUID, if specified.

MaximumVersion

The module maxVersion number if specified, otherwise null.

Name

The module name.

RequiredVersion

The exact version of the module if specified, otherwise null.

Version

The module version number if specified, otherwise null.

Methods

ToString()

Implements ToString() for a module specification. If the specification just contains a Name, then that is returned as is. Otherwise, the object is formatted as a PowerSHell hashtable.

TryParse(String, ModuleSpecification)

Parse the specified string into a ModuleSpecification object.

Applies to