Jegyzékmodul (Manifest Module)

Lehetőség van olyan modul létrehozására is, amiben nincsen modulfájl, csak jegyzékfájl és esetleg .NET építőelemek.

Az előző Popup példához készítettem egy Popup2 alkönyvtárba egy jegyzékfájlt:

#

# Module manifest for module 'popup2'

#

# Generated by: Soós Tibor

#

# Generated on: 2009. 12. 06.

#

 

@{

 

# Script module or binary module file associated with this manifest

ModuleToProcess = ''

 

# Version number of this module.

ModuleVersion = '1.0'

 

# ID used to uniquely identify this module

GUID = '3f235c27-503d-46a5-99b9-58ae300eafea'

 

# Author of this module

Author = 'Soós Tibor'

 

# Company or vendor of this module

CompanyName = 'IQSOFT - John Bryce Oktatóközpont'

 

# Copyright statement for this module

Copyright = '(c) 2009 Soós Tibor. All rights reserved.'

 

# Description of the functionality provided by this module

Description = 'Teszt ModuleManifest'

 

# Minimum version of the Windows PowerShell engine required by this module

PowerShellVersion = ''

 

# Name of the Windows PowerShell host required by this module

PowerShellHostName = ''

 

# Minimum version of the Windows PowerShell host required by this module

PowerShellHostVersion = ''

 

# Minimum version of the .NET Framework required by this module

DotNetFrameworkVersion = ''

 

# Minimum version of the common language runtime (CLR) required by this module

CLRVersion = ''

 

# Processor architecture (None, X86, Amd64, IA64) required by this module

ProcessorArchitecture = ''

 

# Modules that must be imported into the global environment prior to importing this module

RequiredModules = @()

 

# Assemblies that must be loaded prior to importing this module

RequiredAssemblies = @()

 

# Script files (.ps1) that are run in the caller's environment prior to importing this module

ScriptsToProcess = @()

 

# Type files (.ps1xml) to be loaded when importing this module

TypesToProcess = @()

 

# Format files (.ps1xml) to be loaded when importing this module

FormatsToProcess = @()

 

# Modules to import as nested modules of the module specified in ModuleToProcess

NestedModules = 'popup'

 

# Functions to export from this module

FunctionsToExport = '*'

 

# Cmdlets to export from this module

CmdletsToExport = '*'

 

# Variables to export from this module

VariablesToExport = '*'

 

# Aliases to export from this module

AliasesToExport = '*'

 

# List of all modules packaged with this module

ModuleList = @()

 

# List of all files packaged with this module

FileList = @()

 

# Private data to pass to the module specified in ModuleToProcess

PrivateData = ''

 

}

A lényeges rész itt a NestedModules rész, ahol hivatkozom az „igazi” modulra. Ezzel a lehetőséggel egy „igazi” modulhoz akár többfajta jegyzékfájllal más és más exportált változókat, függvényeket és cmdleteket lehet definiálni. Vagy ha a modulom nem egy PSM1 fájlból állna, hanem több szkriptfájl alkotja, akkor a fenti jegyzékfájl NestedModules részében fel lehetne sorolni ezeket a fájlokat:

   NestedModules     = "elsőfájl.ps1", "MásodikFájl.ps1", "HarmadikFájl.ps1"



Word To HTML Converter