qshinoの日記

Powershell関係と徒然なこと

Powershell Module Manifest

Powershell Module Manifest

作成方法は3種類 1. versionのみ 2. New-ModuleManifest 3. テンプレートを写す

Versionのみ

'@{ModuleVersion="1.0"}' > myModuleName.psd1

New-ModuleManifest

New-ModuleManifest myModuleName.psd1 -ModuleVersion "2.0" -Author "YourNameHere"

テンプレートを写す

最後に追加

検査方法

Test-ModuleManifest myModuleName.psd1

設置場所

モジュールファイルと同じディレクトリ、同じファイル名(拡張子除く)で保存。

例) モジュールファイルが、下記の場合 c:\aaa.psm1

Manifestは

c:\aaa.psd1

参考/msdn/概要

https://msdn.microsoft.com/en-us/library/dd878337(v=vs.85).aspx

参考/new-modulemanifestコマンド

http://go.microsoft.com/fwlink/?LinkID=141555

テンプレート

#

Module manifest for module ‘myManifest’

#

Generated by: User01

#

Generated on: 1/24/2012

#

@{

Script module or binary module file associated with this manifest

RootModule = ‘’

Version number of this module.

ModuleVersion = ‘1.0’

ID used to uniquely identify this module

GUID = ‘d0a9150d-b6a4-4b17-a325-e3a24fed0aa9’

Author of this module

Author = ‘User01’

Company or vendor of this module

CompanyName = ‘Unknown’

Copyright statement for this module

Copyright = ‘© 2012 User01. All rights reserved.’

Description of the functionality provided by this module

Description = ‘’

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) 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 RootModule/ModuleToProcess

NestedModules = @()

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 RootModule/ModuleToProcess

PrivateData = ‘’

HelpInfo URI of this module

HelpInfoURI = ‘’

Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.

DefaultCommandPrefix = ‘’

}

以上