From b4d4e6d10fdc1ff1f108a4da511f32be48c89b1a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 26 Jul 2023 14:49:03 +0200 Subject: [PATCH] Fix encoding of app association file --- scripts/Windows/Scripts/AppAssociations.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Scripts/AppAssociations.ps1 b/scripts/Windows/Scripts/AppAssociations.ps1 index 403a125b..327f99f4 100644 --- a/scripts/Windows/Scripts/AppAssociations.ps1 +++ b/scripts/Windows/Scripts/AppAssociations.ps1 @@ -30,7 +30,11 @@ $null = New-Module { $association.ApplicationName = $applicationName; $configFile = New-TemporaryFile; - $associations.Save($configFile.FullName); + $writerSettings = [System.Xml.XmlWriterSettings]::new(); + $writerSettings.Indent = $true; + $writerSettings.Encoding = [System.Text.UTF8Encoding]::new(); + $writer = [System.Xml.XmlWriter]::Create($configFile.FullName, $writerSettings); + $associations.Save($writer); DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)"; Remove-Item $configFile; }