diff --git a/scripts/Windows/Scripts/Registry.ps1 b/scripts/Windows/Scripts/Registry.ps1 index 767d3361..178cba2d 100644 --- a/scripts/Windows/Scripts/Registry.ps1 +++ b/scripts/Windows/Scripts/Registry.ps1 @@ -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]); + } + } }