Skip to content

Commit

Permalink
updated module
Browse files Browse the repository at this point in the history
  • Loading branch information
jformacek committed Dec 23, 2024
1 parent 9c009cf commit 8e30b8d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,24 @@ jobs:
}
Write-Host "Signed files summary:"
Get-AuthenticodeSignature -FilePath $files
- name: Publish
#Publish to PS Gallery
shell: pwsh
if: ${{ github.event_name != 'workflow_dispatch' }}
env:
SECRET: ${{ secrets.GC_PSGALLERY_APIKEY }}
run: |
write-host "Publishing from: $env:GITHUB_WORKSPACE\Module\$env:MODULE_NAME"
try
{
$env:PSModulePath = "$env:PSModulePath;$env:GITHUB_WORKSPACE\Module"
"PSModulePath: $env:PSModulePath"
Publish-Module -Path "$env:GITHUB_WORKSPACE\Module\$env:MODULE_NAME" -NuGetApiKey "$env:SECRET"
}
catch
{
Write-Host "Error: $($_.Exception)"
throw
}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,4 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
.vscode/launch.json
4 changes: 2 additions & 2 deletions Module/SpfAnalyzer/SpfAnalyzer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = '.\SpfAnalyzer.psm1'

# Version number of this module.
ModuleVersion = '0.0.1'
ModuleVersion = '0.0.2'

# Supported PSEditions
CompatiblePSEditions = @('Core')
Expand Down Expand Up @@ -69,7 +69,7 @@ Description = 'Module provides functions for SPF record analysis.'
# NestedModules = @()

# Functions 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 functions to export.
FunctionsToExport = @('Get-SpfRecord')
FunctionsToExport = @('Get-SpfRecord', 'Get-SpfRecordIpAddress', 'Get-SpfRecordIpNetwork')

# 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 = @()
Expand Down
32 changes: 32 additions & 0 deletions Module/SpfAnalyzer/SpfAnalyzer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,36 @@ function Get-SPFRecord
[DnsApi.Domain]::GetSpfRecord($Domain)
}

function Get-SpfRecordIpNetwork
{
[CmdletBinding()]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[DnsApi.SpfRecord]$SpfRecord
)

process
{
Write-Verbose "Processing $spfRecord"
$SpfRecord.Entries | Where-Object { $_ -is [System.Net.IPNetwork] }
}
}

function Get-SpfRecordIpAddress
{
[CmdletBinding()]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[DnsApi.SpfRecord]$SpfRecord
)

process
{
Write-Verbose "Processing $spfRecord"
$SpfRecord.Entries | Where-Object { $_ -is [System.Net.IPAddress] }
}
}

Init

0 comments on commit 8e30b8d

Please sign in to comment.