ModuleSpecification ModuleSpecification ModuleSpecification Class


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 class ModuleSpecification
type ModuleSpecification = class
Public Class ModuleSpecification


ModuleSpecification() ModuleSpecification() ModuleSpecification()

Default constructor

ModuleSpecification(Hashtable) ModuleSpecification(Hashtable) 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) ModuleSpecification(String) ModuleSpecification(String)

Construct a module specification from the module name.


Guid Guid Guid

The module GUID, if specified.

MaximumVersion MaximumVersion MaximumVersion

The module maxVersion number if specified, otherwise null.

Name Name Name

The module name.

RequiredVersion RequiredVersion RequiredVersion

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

Version Version Version

The module version number if specified, otherwise null.


ToString() ToString() 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) TryParse(String, ModuleSpecification) TryParse(String, ModuleSpecification)

Parse the specified string into a ModuleSpecification object

Applies to