Add a function for removing the RunOnce key

This commit is contained in:
Manuel Thalmann 2024-08-10 15:24:04 +02:00
parent 3ad0fcf95e
commit 6dba078a44

View file

@ -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.