win_regedit: stabilise tests (#38912)

This commit is contained in:
Jordan Borean
2018-04-18 08:11:44 +10:00
committed by GitHub
parent 26312b6557
commit 77ef4802f0
3 changed files with 4 additions and 8 deletions

View File

@@ -562,6 +562,7 @@ $key_prefix[$path]
} finally {
if ($hive) {
[GC]::Collect()
[GC]::WaitForPendingFinalizers()
try {
[Ansible.RegistryUtil]::UnloadHive("ANSIBLE")
} catch [System.ComponentModel.Win32Exception] {