Skip to content

Commit bd9d9d3

Browse files
authored
Merge branch '4.14.0' into 4.13.1
2 parents 35895c3 + 967b6a4 commit bd9d9d3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
* PowerSTIG Convert should add newline to raw Xccdf to ensure Pester tests Pass : [#1118](https://github.com/microsoft/PowerStig/issues/1118)
6+
57
## [4.13.1] - 2022-06-27
68

79
* Fixed:Split-BenchmarkId returns the wrong value for Windows Defender V2R4 [#1121](https://github.com/microsoft/PowerStig/issues/1121)

source/Module/STIG/Convert/Functions.PowerStigXml.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ function ConvertTo-PowerStigXml
249249
{
250250
$convertedStigObjects = ConvertFrom-StigXccdf -Path $Path -RuleIdFilter $RuleIdFilter
251251

252+
# Add a newline to end of raw xccdf if it doesn't exist
253+
$rawXccdf = Get-Content -Path $Path
254+
$fileLength = $rawXccdf.Length
255+
$lastLine = $rawXccdf[$fileLength - 1]
256+
257+
if ($lastline -ne '')
258+
{
259+
Add-Content -Path $path -Value ''
260+
}
261+
252262
# Get the raw xccdf xml to pull additional details from the root node.
253263
[xml] $xccdfXml = Get-Content -Path $Path -Encoding UTF8
254264
[version] $stigVersionNumber = Get-StigVersionNumber -StigDetails $xccdfXml

0 commit comments

Comments
 (0)