From 65a21363d9851c90c7ca1642e4a510b67e7062ce Mon Sep 17 00:00:00 2001
From: codaamok <me@cookadam.co.uk>
Date: Tue, 20 Sep 2022 17:13:34 +0100
Subject: [PATCH] Updated Export-UnreleasedNotes

---
 CHANGELOG.md                                | 2 ++
 src/Public/Build/Export-UnreleasedNotes.ps1 | 2 +-
 src/Public/Build/Get-BuildVersionNumber.ps1 | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 92540cd..35cfeb8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,6 @@
 ## [Unreleased]
+### Fixed
+- `Export-UnreleasedNotes` incorrectly checked `IsPresent` property of a boolean for param `-NewRelease`. This param was once a switch, but then change to a bool.
 
 ## [5.0.1] - 2022-04-20
 ### Changed
diff --git a/src/Public/Build/Export-UnreleasedNotes.ps1 b/src/Public/Build/Export-UnreleasedNotes.ps1
index 58be503..5e9623c 100644
--- a/src/Public/Build/Export-UnreleasedNotes.ps1
+++ b/src/Public/Build/Export-UnreleasedNotes.ps1
@@ -43,7 +43,7 @@ function Export-UnreleasedNotes {
     }
 
     if ($EmptyChangeLog -eq $true -Or $ReleaseNotes.Count -eq 0) {
-        if ($NewRelease.IsPresent) {
+        if ($NewRelease) {
             throw "Can not build with empty Unreleased section in the change log"
         }
         else {
diff --git a/src/Public/Build/Get-BuildVersionNumber.ps1 b/src/Public/Build/Get-BuildVersionNumber.ps1
index c1ce9f0..ea2cd3c 100644
--- a/src/Public/Build/Get-BuildVersionNumber.ps1
+++ b/src/Public/Build/Get-BuildVersionNumber.ps1
@@ -46,7 +46,7 @@ function Get-BuildVersionNumber {
     Write-Verbose ("Manifest version: {0}" -f $ManifestData.ModuleVersion) -Verbose
 
     if (-not $VersionToBuild) {
-        if ($NewRelease.IsPresent) {
+        if ($NewRelease) {
             # Try and piece together an understanding from the module manifest, PowerShell Gallery, and the change log, as to what the next version number should be
 
             # If the last released version in the change log and latest version available in the PowerShell gallery do not match, throw an exception - get them level!