diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index 5f4a6226..6dc26435 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -96,6 +96,21 @@ $null = New-Module { $key.Handle.Close(); } + <# + .SYNOPSIS + Clears leftovers from past registrations. + #> + function Clear-SetupRegistration { + Edit-DefaultUserKey { + param( + [RegistryKey] $Key + ) + + $runOnceKey = Get-RunOnceKey $Key; + Remove-Item $runOnceKey.PSPath; + } + } + <# .SYNOPSIS Sets the user to login automatically on boot.