Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ permissions:
contents: write

on:
push:
pull_request:
types: [closed]
branches:
- main

jobs:
release:
# Only run if merge PR message includes 'develop'
if: startsWith(github.event.head_commit.message, 'Merge pull request') && contains(github.event.head_commit.message, 'develop')
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'develop'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
mkdir -p output
ls
zip -r output/release.zip module
zip -r output/release.zip PiHoleShell

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
Expand All @@ -61,4 +61,4 @@ jobs:
name: "Release ${{ steps.bump.outputs.new_tag }}"
files: output/release.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/PSScriptAnalyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
run: |
(Get-ChildItem -Recurse).FullName
Install-Module -Name PSScriptAnalyzer -Confirm:$true -Force
if (Test-Path -Path "C:\a\PiHoleShell\PiHoleShell\module") {
Invoke-ScriptAnalyzer -Path C:\a\PiHoleShell\PiHoleShell\module -Recurse -EnableExit
if (Test-Path -Path "C:\a\PiHoleShell\PiHoleShell\PiHoleShell") {
Invoke-ScriptAnalyzer -Path C:\a\PiHoleShell\PiHoleShell\PiHoleShell -Recurse -EnableExit
}
else {
Invoke-ScriptAnalyzer -Path D:\a\PiHoleShell\PiHoleShell\module -Recurse -EnableExit
Invoke-ScriptAnalyzer -Path D:\a\PiHoleShell\PiHoleShell\PiHoleShell -Recurse -EnableExit
}


24 changes: 24 additions & 0 deletions PiHoleShell/PiHoleShell.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@{
RootModule = 'PiHoleShell.psm1'
ModuleVersion = '0.0.0'
GUID = 'b3cecc78-fe8f-49c6-9015-3d66ef5d49cb'
Author = 'Mike Madeja'
Description = 'A module to interact with PiHole API'
CompatiblePSEditions = @('Core') # PowerShell 7+ only

PowerShellVersion = '7.0'

FunctionsToExport = @('Get-PiHoleGroup', 'New-PiHoleGroup', 'Update-PiHoleGroup', 'Remove-PiHoleGroup', 'Get-PiHoleDnsBlockingStatus', 'Set-PiHoleDnsBlocking', 'Get-PiHoleConfig', 'Get-PiHoleCurrentAuthSession', 'Remove-PiHoleAuthSession')
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @()

PrivateData = @{
PSData = @{
Tags = @('PiHole', 'PowerShell7')
LicenseUri = 'https://github.com/mikemadeja/PiHoleShell/blob/main/LICENSE'
ProjectUri = 'https://github.com/mikemadeja/PiHoleShell'
ReleaseNotes = 'Initial release targeting PowerShell 7+'
}
}
}
6 changes: 6 additions & 0 deletions PiHoleShell/PiHoleShell.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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 }
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,4 @@ Get-PiHoleCurrentAuthSession -PiHoleServer "http://pihole.domain.com:8080" -Pass
Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid -IgnoreSsl $IgnoreSsl
}
}
}

Export-ModuleMember -Function Get-PiHoleCurrentAuthSession, Remove-PiHoleAuthSession
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ https://TODO
Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid -IgnoreSsl $IgnoreSsl
}
}
}

Export-ModuleMember -Function Get-PiHoleConfig
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,4 @@ Set-PiHoleDnsBlocking -PiHoleServer "http://pihole.domain.com:8080" -Password "f
Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid -IgnoreSsl $IgnoreSsl
}
}
}

Export-ModuleMember -Function Get-PiHoleDnsBlockingStatus, Set-PiHoleDnsBlocking
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,4 @@ https://TODO
Remove-PiHoleCurrentAuthSession -PiHoleServer $PiHoleServer -Sid $Sid -IgnoreSsl $IgnoreSsl
}
}
}

Export-ModuleMember -Function Get-PiHoleGroup, New-PiHoleGroup, Update-PiHoleGroup, Remove-PiHoleGroup
}
File renamed without changes.
7 changes: 0 additions & 7 deletions module/PiHoleShell.psm1

This file was deleted.