Dispose the XML writer after use
This commit is contained in:
parent
ee4434f91a
commit
7ae8d7f2c6
1 changed files with 1 additions and 0 deletions
|
@ -35,6 +35,7 @@ $null = New-Module {
|
||||||
$writerSettings.Encoding = [System.Text.UTF8Encoding]::new();
|
$writerSettings.Encoding = [System.Text.UTF8Encoding]::new();
|
||||||
$writer = [System.Xml.XmlWriter]::Create($configFile.FullName, $writerSettings);
|
$writer = [System.Xml.XmlWriter]::Create($configFile.FullName, $writerSettings);
|
||||||
$associations.Save($writer);
|
$associations.Save($writer);
|
||||||
|
$writer.Dispose();
|
||||||
DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
|
DISM /Online "/Import-DefaultAppAssociations:$($configFile.FullName)";
|
||||||
Remove-Item $configFile;
|
Remove-Item $configFile;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue