From fed37bb2fc5f57d1e1144db5e2dd37936b21a43d Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 21 Aug 2024 11:25:53 +0200 Subject: [PATCH] [common] Add VM-Set-Legal-Notice helper function Add `VM-Set-Legal-Notice` helper function to set the legal notice to the desired text. The legal notice caption used is `Terms and Conditions`. --- packages/common.vm/common.vm.nuspec | 2 +- packages/common.vm/tools/vm.common/vm.common.psm1 | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index d5ad0d313..de4cac64f 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20240612 + 0.0.0.20240821 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index ba31d8198..0ce9a4baf 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -1789,3 +1789,14 @@ function VM-Uninstall-With-Pip { VM-Pip-Uninstall $toolName VM-Remove-Tool-Shortcut $toolName $category } + +function VM-Set-Legal-Notice { + param ( + [Parameter(Mandatory=$true)] + [string[]]$legalnoticetext + ) + $RegistryPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + New-ItemProperty -Path $RegistryPath -Name legalnoticecaption -Value "Terms and Conditions" -Force + New-ItemProperty -Path $RegistryPath -Name legalnoticetext -Value $legalnoticetext -Force +} +