From 6149307cc58017b6d3a7451f5e6878d517464a31 Mon Sep 17 00:00:00 2001 From: Claudio Spizzi Date: Mon, 18 Feb 2019 11:11:34 +0100 Subject: [PATCH] Version 3.0.0 --- CHANGELOG.md | 12 +-- Modules/ScriptConfig/ScriptConfig.psd1 | 130 ++++++++++++++++++++----- Modules/ScriptConfig/ScriptConfig.psm1 | 33 ++++++- README.md | 4 +- 4 files changed, 144 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3171c11..7ffa9e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,36 +6,36 @@ The format is mainly based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## Unreleased +## 3.0.0 - 2019-02-18 * Changed: Get the default config path from the PS call stack * Changed: The default configuration file type is now JSON (BREAKING CHANGE) -## 2.0.0 +## 2.0.0 - 2016-12-12 * Changed: Convert module to new deployment model * Changed: Rework code against high quality module guidelines by Microsoft * Changed: Remove positional parameters (BREAKING CHANGE) -## 1.0.3 +## 1.0.3 - 2016-02-09 * Added: Formats and types resources -## 1.0.2 +## 1.0.2 - 2016-02-03 * Fixed: Default path issue for Get-ScriptConfig -## 1.0.1 +## 1.0.1 - 2016-01-29 * Updated: File encoding to UTF8 w/o BOM * Updated: Demo and help * Added: Enhance parameters for Get-ScriptConfig function -## 1.0.0 +## 1.0.0 - 2016-01-21 * Added: Initial public release diff --git a/Modules/ScriptConfig/ScriptConfig.psd1 b/Modules/ScriptConfig/ScriptConfig.psd1 index 8a2e2b7..4f988f9 100644 --- a/Modules/ScriptConfig/ScriptConfig.psd1 +++ b/Modules/ScriptConfig/ScriptConfig.psd1 @@ -1,32 +1,118 @@ @{ - RootModule = 'ScriptConfig.psm1' - ModuleVersion = '2.0.0' - GUID = '0464897C-2F37-489F-93B2-7F6B9B582761' - Author = 'Claudio Spizzi' - Copyright = 'Copyright (c) 2016 by Claudio Spizzi. Licensed under MIT license.' - Description = 'PowerShell Module to handle configuration files for PowerShell controller scripts.' + # Script module or binary module file associated with this manifest. + RootModule = 'ScriptConfig.psm1' + + # Version number of this module. + ModuleVersion = '3.0.0' + + # Supported PSEditions + # CompatiblePSEditions = @() + + # ID used to uniquely identify this module + GUID = '0464897C-2F37-489F-93B2-7F6B9B582761' + + # Author of this module + Author = 'Claudio Spizzi' + + # Company or vendor of this module + # CompanyName = '' + + # Copyright statement for this module + Copyright = 'Copyright (c) 2019 by Claudio Spizzi. Licensed under MIT license.' + + # Description of the functionality provided by this module + Description = 'PowerShell Module to handle configuration files for PowerShell controller scripts.' + + # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '3.0' - RequiredModules = @() - RequiredAssemblies = @() - ScriptsToProcess = @() - TypesToProcess = @( + + # 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 Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # DotNetFrameworkVersion = '' + + # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # 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 = @( 'Resources\ScriptConfig.Types.ps1xml' ) - FormatsToProcess = @( + + # Format files (.ps1xml) to be loaded when importing this module + FormatsToProcess = @( 'Resources\ScriptConfig.Formats.ps1xml' ) + + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + # NestedModules = @() + + # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( 'Get-ScriptConfig' ) - CmdletsToExport = @() - VariablesToExport = @() - AliasesToExport = @() - PrivateData = @{ - PSData = @{ - Tags = @('PSModule', 'Config', 'Configuration', 'Script', 'Controller') - LicenseUri = 'https://raw.githubusercontent.com/claudiospizzi/ScriptConfig/master/LICENSE' - ProjectUri = 'https://github.com/claudiospizzi/ScriptConfig' - ExternalModuleDependencies = @() - } - } + + # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. + # CmdletsToExport = @() + + # Variables to export from this module + # VariablesToExport = @() + + # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. + # AliasesToExport = @() + + # DSC resources to export from this module + # DscResourcesToExport = @() + + # 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. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @('PSModule', 'Config', 'Configuration', 'Script', 'Controller') + + # A URL to the license for this module. + LicenseUri = 'https://raw.githubusercontent.com/claudiospizzi/ScriptConfig/master/LICENSE' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/claudiospizzi/ScriptConfig' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + } # End of PSData hashtable + + } # End of PrivateData hashtable + + # HelpInfo URI of this module + # HelpInfoURI = '' + + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' } diff --git a/Modules/ScriptConfig/ScriptConfig.psm1 b/Modules/ScriptConfig/ScriptConfig.psm1 index ef56130..52d35a7 100644 --- a/Modules/ScriptConfig/ScriptConfig.psm1 +++ b/Modules/ScriptConfig/ScriptConfig.psm1 @@ -1,12 +1,35 @@ +<# + .SYNOPSIS + Root module file. -# Get and dot source all helper functions (private) + .DESCRIPTION + The root module file loads all classes, helpers and functions into the + module context. +#> + + +## Module loader + +# Get and dot source all classes (internal) Split-Path -Path $PSCommandPath | - Join-Path -ChildPath 'Helpers' | - Get-ChildItem -Include '*.ps1' -Exclude '*.Tests.*' -Recurse | + Get-ChildItem -Filter 'Classes' -Directory | + Get-ChildItem -Include '*.ps1' -File -Recurse | + ForEach-Object { . $_.FullName } + +# Get and dot source all helper functions (internal) +Split-Path -Path $PSCommandPath | + Get-ChildItem -Filter 'Helpers' -Directory | + Get-ChildItem -Include '*.ps1' -File -Recurse | ForEach-Object { . $_.FullName } # Get and dot source all external functions (public) Split-Path -Path $PSCommandPath | - Join-Path -ChildPath 'Functions' | - Get-ChildItem -Include '*.ps1' -Exclude '*.Tests.*' -Recurse | + Get-ChildItem -Filter 'Functions' -Directory | + Get-ChildItem -Include '*.ps1' -File -Recurse | ForEach-Object { . $_.FullName } + + +## Module configuration + +# Module path +New-Variable -Name 'ModulePath' -Value $PSScriptRoot diff --git a/README.md b/README.md index 3bcf3e1..ef1199c 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ Studio Code and ensure that the PowerShell extension is installed. [ScriptLogger]: https://github.com/claudiospizzi/ScriptLogger -[PowerShell Gallery]: https://www.powershellgallery.com/packages/ScriptLogger -[GitHub Releases]: https://github.com/claudiospizzi/ScriptLogger/releases +[PowerShell Gallery]: https://www.powershellgallery.com/packages/ScriptConfig +[GitHub Releases]: https://github.com/claudiospizzi/ScriptConfig/releases [Installing a PowerShell Module]: https://msdn.microsoft.com/en-us/library/dd878350 [CHANGELOG.md]: CHANGELOG.md