Clean up after restoration

This commit is contained in:
Manuel Thalmann 2023-07-03 13:24:36 +02:00
parent ba64517d3b
commit 0cfea82920
2 changed files with 7 additions and 0 deletions

View file

@ -42,4 +42,5 @@ function Restore-WindowsInstallation([Context] $context) {
Restore-PersonalFiles $context;
Restore-PersonalApps $context;
Remove-Item -Recurse $context.RootDir;
$context.Cleanup();
}

View file

@ -273,4 +273,10 @@ class Context {
Restart-Computer;
exit;
}
[void] Cleanup() {
$this.DeregisterNewUserReboot();
$this.RemoveAutologin();
Remove-Item $($this.EnsureConfigKey().PSPath);
}
}