From 887972c921802c1bbeb5a27a3f64d78d56842854 Mon Sep 17 00:00:00 2001 From: Adam Haynes Date: Fri, 17 Aug 2018 16:11:53 +0200 Subject: [PATCH] Manifest fix (#80) * fixed document module load * added test * rem spaces * updated module test --- PowerStig.Document.psm1 | 6 ------ PowerStig.psd1 | 7 ++----- PowerStig.psm1 | 12 +++++++++--- README.md | 2 -- Tests/Integration/PowerStig.Integration.tests.ps1 | 4 ++++ 5 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 PowerStig.Document.psm1 diff --git a/PowerStig.Document.psm1 b/PowerStig.Document.psm1 deleted file mode 100644 index 8b1362b6a..000000000 --- a/PowerStig.Document.psm1 +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -using module .\Module\Document.Main\Document.Main.psm1 - -Export-ModuleMember -Function 'New-StigCheckList' diff --git a/PowerStig.psd1 b/PowerStig.psd1 index 14592bd7b..6cc3a487d 100644 --- a/PowerStig.psd1 +++ b/PowerStig.psd1 @@ -2,11 +2,8 @@ # Licensed under the MIT License. @{ -# Modules to import as nested modules of the module specified in ModuleToProcess -NestedModules = @( - 'PowerStig.psm1', - 'PowerStig.Document.psm1' -) +# Script module or binary module file associated with this manifest. +RootModule = 'PowerStig.psm1' # Version number of this module. ModuleVersion = '1.1.1.0' diff --git a/PowerStig.psm1 b/PowerStig.psm1 index 69fd7629d..ffeafa422 100644 --- a/PowerStig.psm1 +++ b/PowerStig.psm1 @@ -10,8 +10,13 @@ using module .\Module\Stig.StigException\Stig.StigException.psm1 using module .\Module\Stig.TechnologyRole\Stig.TechnologyRole.psm1 using module .\Module\Stig.TechnologyVersion\Stig.TechnologyVersion.psm1 -# load the public functions -Foreach ($supportFile in ( Get-ChildItem -Path "$PSScriptRoot\Module\Stig.Main" -Filter '*.ps1' ) ) +# load the public StigData functions + +$pathList = @( + "$PSScriptRoot\Module\Stig.Main", + "$PSScriptRoot\Module\Document.Main" +) +Foreach ($supportFile in (Get-ChildItem -Path $pathList -Filter '*.ps1')) { Write-Verbose "Loading $($supportFile.FullName)" . $supportFile.FullName @@ -20,5 +25,6 @@ Foreach ($supportFile in ( Get-ChildItem -Path "$PSScriptRoot\Module\Stig.Main" Export-ModuleMember -Function @( 'Get-OrgSettingsObject', 'Get-DomainName', - 'Get-StigList' + 'Get-StigList', + 'New-StigCheckList' ) diff --git a/README.md b/README.md index 78cd65a72..22cf18410 100644 --- a/README.md +++ b/README.md @@ -168,5 +168,3 @@ Added the following STIGs: * Windows Server DNS V1R9 * Windows AD Domain V2R9 * IE11 V1R15 - - diff --git a/Tests/Integration/PowerStig.Integration.tests.ps1 b/Tests/Integration/PowerStig.Integration.tests.ps1 index f3449678b..b1d8d8153 100644 --- a/Tests/Integration/PowerStig.Integration.tests.ps1 +++ b/Tests/Integration/PowerStig.Integration.tests.ps1 @@ -16,6 +16,10 @@ Import-Module $modulePath -Force Describe "$ModuleName module" { + It 'Should be a Script Module' { + (Get-Module -Name $script:modulePath -ListAvailable).ModuleType | Should Be 'Script' + } + Context 'Exported Commands' { $commands = (Get-Command -Module $ModuleName).Name