Dispose the XML writer after use

This commit is contained in:
Manuel Thalmann 2023-07-26 15:26:02 +02:00
parent ee4434f91a
commit 7ae8d7f2c6

View file

@ -35,6 +35,7 @@ $null = New-Module {
$writerSettings.Encoding = [System.Text.UTF8Encoding]::new();
$writer = [System.Xml.XmlWriter]::Create($configFile.FullName, $writerSettings);
$associations.Save($writer);
$writer.Dispose();
DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
Remove-Item $configFile;
}