Skip to content

Commit

Permalink
Fixed update module
Browse files Browse the repository at this point in the history
  • Loading branch information
ntatschner committed Apr 4, 2024
1 parent ceb298b commit 1bef56e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Modules/Tatux.Utils/Public/Update-NTModuleManifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Modules/Tatux.Utils/Tatux.Utils_test.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '*'
Expand All @@ -56,4 +56,4 @@

} # End of PrivateData hashtable

}
}

0 comments on commit 1bef56e

Please sign in to comment.