Data instead of Value

pull/257/head
KnifMelti 2023-01-03 05:29:13 +01:00
parent f087b13410
commit 9092573861
2 changed files with 6 additions and 6 deletions

View File

@ -15,11 +15,11 @@ $Lnk = @("")
#Registry _value_ (DWord/String) to add in existing registry Key. Example:
#$AddKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate"
#$AddValue = "WAU_BypassListForUsers"
#$AddTypeValue = "1"
#$AddTypeData = "1"
#$AddType = "DWord"
$AddKey = ""
$AddValue = ""
$AddTypeValue = ""
$AddTypeData = ""
$AddType = ""
#Registry _value_ to delete in existing registry Key. Example:
@ -44,8 +44,8 @@ if ($App) {
if ($Lnk) {
Remove-ModsLnk $Lnk
}
if ($AddKey -and $AddValue -and $AddTypeValue -and $AddType) {
Add-ModsReg $AddKey $AddValue $AddTypeValue $AddType
if ($AddKey -and $AddValue -and $AddTypeData -and $AddType) {
Add-ModsReg $AddKey $AddValue $AddTypeData $AddType
}
if ($DelKey -and $DelValue) {
Remove-ModsReg $DelKey $DelValue

View File

@ -136,9 +136,9 @@ function Remove-ModsLnk ($Lnk) {
Return
}
function Add-ModsReg ($AddKey, $AddValue, $AddTypeValue, $AddType) {
function Add-ModsReg ($AddKey, $AddValue, $AddTypeData, $AddType) {
if (Test-Path "$AddKey") {
New-ItemProperty $AddKey -Name $AddValue -Value $AddTypeValue -PropertyType $AddType -Force | Out-Null
New-ItemProperty $AddKey -Name $AddValue -Value $AddTypeData -PropertyType $AddType -Force | Out-Null
}
Return
}