From b36d3b6fdac2e1329011da183716f65f93f45e40 Mon Sep 17 00:00:00 2001 From: Nigel Tatschner Date: Thu, 4 Apr 2024 13:35:54 +0100 Subject: [PATCH] Update Update-NTModuleManifest.ps1 --- Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 b/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 index 243746e..887e6a5 100644 --- a/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 +++ b/Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1 @@ -2,8 +2,8 @@ function Update-NTModuleManifest { [CmdletBinding()] param( [ValidateScript({ - if (-Not (Test-Path -Path $_)) { - throw "Enter a valid path." + if (-Not (Test-Path -Path $_) -or $_.EndsWith(".psd1") -eq $false) { + throw "Enter a valid manifest file." } else { $true } @@ -12,6 +12,10 @@ function Update-NTModuleManifest { ) # Test if paths a valid manifest file and if so has the right field FunctionsToExport + $ManifestFileContent = Get-Content -Path $Path -Raw + if ($ManifestFileContent -match "FunctionsToExport =") { + $LineToReplace = $ManifestFileContent | Select-String -Pattern "^FunctionsToExport = .*$" + } } \ No newline at end of file