Allow displaying a boot message

This commit is contained in:
Manuel Thalmann 2024-08-09 02:59:06 +02:00
parent 1b58282f69
commit e5eff422ff

View file

@ -16,4 +16,33 @@ $null = New-Module {
[System.GC]::Collect();
& reg unload $regRootPath;
}
<#
.SYNOPSIS
Sets a message to show on the login screen.
.PARAMETER Caption
The title of the message.
.PARAMETER Message
The text of the message.
#>
function Set-BootMessage {
param(
[string] $Caption,
[string] $Message
)
$options = @{
legalnoticecaption = $Caption;
legalnoticetext = $Message;
};
foreach ($key in $options.Keys) {
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" `
-Name $key `
-Type "String"
-Value ($options[$key]);
}
}
}