Allow displaying a boot message
This commit is contained in:
parent
c631882854
commit
849d8387cc
1 changed files with 29 additions and 0 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue