Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG/v3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# v3 Changelog

## [v3.1.6]

- Fixed an issue where the MOF file encoding was set to UTF-8 without BOM instead of UTF-16LE required
by the DSC engine.

## [v3.1.5]

- Improved module fingerprint detection to only warn if the actual module contents for the DSC schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

RootModule = 'PSDesiredStateConfiguration.psm1'

ModuleVersion = '3.1.5'
ModuleVersion = '3.1.6'

CompatiblePSEditions = @('Desktop', 'Core')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
RootModule = 'M365DSC.PSDesiredStateConfiguration.psm1'

# Version number of this module.
ModuleVersion = '3.1.5'
ModuleVersion = '3.1.6'

# Supported PSEditions
CompatiblePSEditions = @('Desktop', 'Core')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2624,9 +2624,6 @@ function ImportCimAndScriptKeywordsFromModule
return $foundCimSchema -or $foundScriptSchema
}

#
# Writes a MOF document to disk with a deterministic encoding (UTF-8 without
# BOM) on both Windows PowerShell 5.1 and PowerShell 7.
#
# Builds the OMI_ConfigurationDocument instance that closes a document.
function New-ConfigurationDocumentInstance
Expand Down Expand Up @@ -2655,6 +2652,10 @@ function New-ConfigurationDocumentInstance
" Name=`"$(Get-PSTopConfigurationName)`";`n};"
}

#
# Writes a MOF document to disk as UTF-16LE with a BOM. The MI MOF parser decodes a
# document without a UTF-16 BOM as Latin-1, which corrupts every non-ASCII character.
#
function Write-MofDocumentFile
{
param(
Expand All @@ -2668,7 +2669,7 @@ function Write-MofDocumentFile
)

$resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path)
[System.IO.File]::WriteAllText($resolvedPath, ($Content + "`r`n"), [System.Text.UTF8Encoding]::new($false))
[System.IO.File]::WriteAllText($resolvedPath, ($Content + "`r`n"), [System.Text.UnicodeEncoding]::new($false, $true))
}

#
Expand Down