diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index ad8c502..b687948 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -69,7 +69,7 @@ jobs: $apiKey = '${{ secrets.POWERSHELLGALLERY }}' $modulePath = "PiHoleShell" # Change to your actual module folder $manifest = Get-ChildItem -Path $modulePath -Filter PiHoleShell.psd1 -Recurse | Select-Object -First 1 - (Get-Content $($manifest.fullname)) -replace '0.0.0', $ENV:NEW_TAG | Out-File $manifest.fullname + (Get-Content $($manifest.fullname)) -replace '0.0.0', ($ENV:TAG -replace "v", "") | Out-File $manifest.fullname Write-Host "Replacing 0.0.0 with $ENV:NEW_TAG" diff --git a/PiHoleShell/PiHoleShell.psm1 b/PiHoleShell/PiHoleShell.psm1 index 9e83669..66bbf0d 100644 --- a/PiHoleShell/PiHoleShell.psm1 +++ b/PiHoleShell/PiHoleShell.psm1 @@ -2,5 +2,9 @@ if ($PSVersionTable.PSEdition -ne 'Core') { throw "PiHoleShell module only supports PowerShell Core 7+. You are using $($PSVersionTable.PSEdition) $($PSVersionTable.PSVersion)." } -Get-ChildItem $PSScriptRoot\Private\*.ps1 -Recurse | ForEach-Object { . $_.FullName } -Get-ChildItem $PSScriptRoot\Public\*.ps1 -Recurse | ForEach-Object { . $_.FullName } \ No newline at end of file +# Get all .ps1 files in the 'Public' directory and dot-source them +$PublicFunctions = Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') -Filter '*.ps1' -File + +foreach ($File in $PublicFunctions) { + . $File.FullName +} \ No newline at end of file diff --git a/PiHoleShell/Public/Metrics.ps1 b/PiHoleShell/Public/Metrics.ps1 index 6e4243f..b012841 100644 --- a/PiHoleShell/Public/Metrics.ps1 +++ b/PiHoleShell/Public/Metrics.ps1 @@ -302,6 +302,4 @@ Get-PiHoleStatsSummary -PiHoleServer "http://pihole.domain.com:8080" -Password " Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid -IgnoreSsl $IgnoreSsl } } -} - -Export-ModuleMember -Function Get-PiHoleStatsRecentBlocked, Get-PiHoleStatsQueryType, Get-PiHoleStatsTopDomain, Get-PiHoleStatsSummary \ No newline at end of file +} \ No newline at end of file