Skip to content

Commit

Permalink
Merge branch '4.14.0' into 4.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erjenkin authored Jun 27, 2022
2 parents 35895c3 + 967b6a4 commit bd9d9d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

* PowerSTIG Convert should add newline to raw Xccdf to ensure Pester tests Pass : [#1118](https://github.com/microsoft/PowerStig/issues/1118)

## [4.13.1] - 2022-06-27

* Fixed:Split-BenchmarkId returns the wrong value for Windows Defender V2R4 [#1121](https://github.com/microsoft/PowerStig/issues/1121)
Expand Down
10 changes: 10 additions & 0 deletions source/Module/STIG/Convert/Functions.PowerStigXml.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,16 @@ function ConvertTo-PowerStigXml
{
$convertedStigObjects = ConvertFrom-StigXccdf -Path $Path -RuleIdFilter $RuleIdFilter

# Add a newline to end of raw xccdf if it doesn't exist
$rawXccdf = Get-Content -Path $Path
$fileLength = $rawXccdf.Length
$lastLine = $rawXccdf[$fileLength - 1]

if ($lastline -ne '')
{
Add-Content -Path $path -Value ''
}

# Get the raw xccdf xml to pull additional details from the root node.
[xml] $xccdfXml = Get-Content -Path $Path -Encoding UTF8
[version] $stigVersionNumber = Get-StigVersionNumber -StigDetails $xccdfXml
Expand Down

0 comments on commit bd9d9d3

Please sign in to comment.