Skip to content

Commit

Permalink
add proper console log
Browse files Browse the repository at this point in the history
  • Loading branch information
MyDrift-user committed Nov 3, 2024
1 parent 85cda04 commit 1df18e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/private/Set-WinUtilRegistry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ function Set-WinUtilRegistry {
New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
}

Write-Host "Set $Path\$Name to $Value"
if ($Value -ne "<RemoveEntry>") {
Write-Host "Set $Path\$Name to $Value"
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
}
else{
Write-Host "Remove $Path\$Name"
Remove-ItemProperty -Path $Path -Name $Name -Force -ErrorAction Stop | Out-Null
}
} catch [System.Security.SecurityException] {
Expand Down

0 comments on commit 1df18e7

Please sign in to comment.