From 1bef56ea2fa37037198ff49c23f93094ff9bdf12 Mon Sep 17 00:00:00 2001 From: Nigel Tatschner Date: Thu, 4 Apr 2024 20:24:22 +0100 Subject: [PATCH] Fixed update module --- Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 | 2 +- Modules/Tatux.Utils/Tatux.Utils_test.psd1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 b/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 index 77d6b2b..735bf2c 100644 --- a/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 +++ b/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 @@ -18,7 +18,7 @@ function Update-NTModuleManifest { if ([string]::IsNullOrEmpty($ManifestFileContent -match '[\s|\t]*CmdletsToExport\s*=.*') -eq $false) { $LineWithCmdletsToExport = $($ManifestFileContent | Select-String -Pattern '^[\s|\t]*CmdletsToExport\s*=(.*)$') $LineNumber = $LineWithCmdletsToExport.LineNumber - 1 - $CmdletsToExport = $(Get-ChildItem -Path $PublicFunctions -Filter "*.ps1" | Where-Object { $_.Name -notlike "*.tests.ps1" } | Select-Object -ExpandProperty BaseName ) -join ', ' + $CmdletsToExport = $(Get-ChildItem -Path $PublicFunctions -Filter "*.ps1" | Where-Object {$_.Name -notlike "*.tests.ps1" } | % {'"' + $($_ | Select-Object -ExpandProperty BaseName) + '"' } ) -join ', ' $NewLine = " @($CmdletsToExport)" Write-Output "Replacing line: $($LineWithCmdletsToExport.Matches.Groups[1].Value) with $NewLine" $ManifestFileContent[$LineNumber] = $ManifestFileContent[$LineNumber] -replace [regex]::Escape($LineWithCmdletsToExport.Matches.Groups[1].Value), $NewLine diff --git a/Modules/Tatux.Utils/Tatux.Utils_test.psd1 b/Modules/Tatux.Utils/Tatux.Utils_test.psd1 index a6676e6..1707e0d 100644 --- a/Modules/Tatux.Utils/Tatux.Utils_test.psd1 +++ b/Modules/Tatux.Utils/Tatux.Utils_test.psd1 @@ -36,7 +36,7 @@ FunctionsToExport = '*' # 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 = '*' + CmdletsToExport = @("ConvertFrom-NTFlatJSON", "ConvertFrom-NTInvalidFolderCharacters", "ConvertTo-NTFlatJSON", "Generate-NTPassword", "Get-NTBreakTimer", "Get-NTComplianceExportURL", "Get-NTSoftware", "Get-NTSystemInfo", "Invoke-NativeExpression", "Invoke-NTCommandExclusivity", "New-NTModuleTemplate", "New-NTPesterTests", "Remove-NTDiacritics", "Replace-String", "Save-NTGitHubFile", "Search-Exceldoc", "Search-PDFDoc", "Search-Worddoc", "Update-NTModuleManifest", "Write-NTSPLog") # Variables to export from this module VariablesToExport = '*' @@ -56,4 +56,4 @@ } # End of PrivateData hashtable - } \ No newline at end of file + }