Skip to content

Commit

Permalink
Restore PS 5.1 compatibility.
Browse files Browse the repository at this point in the history
Due to a missing backtick, this module was no longer loading on downlevel
versions of PowerShell (specifically, Windows PowerShell 5.1).  The older
versions considered this a syntax error, despite PowerShell 7 loading and
parsing the .psm1 file correctly.

This commit fixes that by adding one missing backtick in the right place.

Thank you to my colleague, Aslan Grealis, for finding this flaw.
  • Loading branch information
rhymeswithmogul committed Jan 24, 2024
1 parent 3a63a53 commit c54ba15
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# MailPolicyExplainer Change Log

## Version 1.3.4 (Wednesday, January 24, 2024)
**FIX** Some previous versions of this module failed to load on Windows PowerShell 5.1 due to a missing backtick. PowerShell 7 considered this to be valid syntax. Thanks to Aslan Grealis for finding this bug.

## Version 1.3.3 (Thursday, January 18, 2024)
**FIX** When no DANE records are present for a domain with a single MX host, `Test-DaneRecords` would erroneously report the domain name when it should have reported the MX server name.

Expand Down
6 changes: 2 additions & 4 deletions MailPolicyExplainer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RootModule = 'src/MailPolicyExplainer.psm1'

# Version number of this module.
ModuleVersion = '1.3.3'
ModuleVersion = '1.3.4'

# Supported PSEditions
CompatiblePSEditions = @('Core', 'Desktop')
Expand Down Expand Up @@ -112,9 +112,7 @@ PrivateData = @{
ProjectUri = 'https://github.com/rhymeswithmogul/MailPolicyExplainer'
IconUri = 'https://raw.githubusercontent.com/rhymeswithmogul/MailPolicyExplainer/main/icon/PSGallery.png'

ReleaseNotes = 'This is a bugfix release. When no DANE records are present for a domain with a single MX host, `Test-DaneRecords` would erroneously report the domain name when it should have reported the MX server name.
For example, if the only MX record was pointing to mail.contoso.com, the old error message would have said "DANE records are not present for contoso.com" instead of "DANE records are not present for mail.contoso.com".'
ReleaseNotes = 'Some previous versions of this module failed to load on Windows PowerShell 5.1 due to a missing backtick. PowerShell 7 considered this to be valid syntax.'
}
}

Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# MailPolicyExplainer News

## Version 1.3.4
This was released on Wednesday, January 24, 2024.

This is a bugfix release. Due to a tiny syntax error, this module was not loading on Windows PowerShell 5.1. This has been corrected. PowerShell 7 was not affected. Thank you to Aslan Grealis for pointing this out.

## Version 1.3.3
This was released on Thursday, January 17, 2024.

Expand Down
2 changes: 1 addition & 1 deletion src/MailPolicyExplainer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Function Test-DaneRecord
# Fetch all MX records for this domain. We won't do a DNSSEC check here,
# since we did that if the user entered here via Test-MailFlow.
$MXServers = @()
Invoke-GooglePublicDnsApi $DomainName 'MX' -Debug:$DebugPreference
Invoke-GooglePublicDnsApi $DomainName 'MX' -Debug:$DebugPreference `
| Select-Object -ExpandProperty Answer `
| Where-Object type -eq 15 `
| Select-Object -ExpandProperty Data `
Expand Down

0 comments on commit c54ba15

Please sign in to comment.