Skip to content

Commit

Permalink
[common] Add VM-Set-Legal-Notice helper function
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
Ana06 committed Aug 21, 2024
1 parent 9dffd97 commit fed37bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20240612</version>
<version>0.0.0.20240821</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
11 changes: 11 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit fed37bb

Please sign in to comment.