Fix encoding of app association file
This commit is contained in:
parent
7cf1d9c599
commit
b4d4e6d10f
1 changed files with 5 additions and 1 deletions
|
@ -30,7 +30,11 @@ $null = New-Module {
|
||||||
$association.ApplicationName = $applicationName;
|
$association.ApplicationName = $applicationName;
|
||||||
|
|
||||||
$configFile = New-TemporaryFile;
|
$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)";
|
DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
|
||||||
Remove-Item $configFile;
|
Remove-Item $configFile;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue