Skip to content

Instantly share code, notes, and snippets.

View thenikk's full-sized avatar
🎯
Focusing

Niklas Tinner thenikk

🎯
Focusing
View GitHub Profile
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations"
$registryName = "DWMFRAMEINTERVAL"
$desiredValue = 15
if (Test-Path -Path $registryPath) {
$keyValue = Get-ItemProperty -Path $registryPath -Name $registryName -ErrorAction SilentlyContinue
if ($keyValue -ne $null -and $keyValue.$registryName -eq $desiredValue) {
Write-Output "Registry key '$registryName' exists with value $($keyValue.$registryName)"
exit 0