Add a function for removing the RunOnce key

This commit is contained in:
Manuel Thalmann 2024-08-10 15:24:04 +02:00
parent 7632e91793
commit 61e38c2bec

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.