Skip to content

Commit

Permalink
Update Update-NTModuleManifest.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
ntatschner authored Apr 4, 2024
1 parent 04d314f commit b36d3b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 = .*$"
}

}

0 comments on commit b36d3b6

Please sign in to comment.