@@ -40,19 +40,32 @@ function Get-ChangeLogEntriesFromContent {
4040 $changeLogEntries = [Ordered ]@ {}
4141 try {
4242 # walk the document, finding where the version specifiers are and creating lists
43- $changeLogEntry = $null
4443 foreach ($line in $changeLogContent ) {
4544 if ($line -match $RELEASE_TITLE_REGEX ) {
4645 $changeLogEntry = [pscustomobject ]@ {
4746 ReleaseVersion = $matches [" version" ]
4847 ReleaseStatus = $matches [" releaseStatus" ]
4948 ReleaseTitle = " ## {0} {1}" -f $matches [" version" ], $matches [" releaseStatus" ]
5049 ReleaseContent = @ ()
50+ Sections = @ {}
5151 }
5252 $changeLogEntries [$changeLogEntry.ReleaseVersion ] = $changeLogEntry
5353 }
5454 else {
5555 if ($changeLogEntry ) {
56+ if ($line.Trim () -match " ^###\s(?<sectionName>.*)" )
57+ {
58+ $sectionName = $matches [" sectionName" ].Trim()
59+ $changeLogEntry.Sections [$sectionName ] = @ ()
60+ $changeLogEntry.ReleaseContent += $line
61+ continue
62+ }
63+
64+ if ($sectionName )
65+ {
66+ $changeLogEntry.Sections [$sectionName ] += $line
67+ }
68+
5669 $changeLogEntry.ReleaseContent += $line
5770 }
5871 }
@@ -195,7 +208,19 @@ function New-ChangeLogEntry {
195208 return $null
196209 }
197210
198- if (! $Content ) { $Content = @ () }
211+ if (! $Content ) {
212+ $Content = @ ()
213+ $Content += " "
214+ $Content += " ### Features Added"
215+ $Content += " "
216+ $Content += " ### Breaking Changes"
217+ $Content += " "
218+ $Content += " ### Key Bugs Fixed"
219+ $Content += " "
220+ $Content += " ### Fixed"
221+ $Content += " "
222+ $Content += " "
223+ }
199224
200225 $newChangeLogEntry = [pscustomobject ]@ {
201226 ReleaseVersion = $Version
0 commit comments