Retrieve registry value properly

This commit is contained in:
Manuel Thalmann 2024-08-10 19:26:53 +02:00
parent efe6f1d924
commit c4377c1005

View file

@ -454,7 +454,7 @@ $null = New-Module {
$timeZoneOption = "Start";
$timeZoneKey = "HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate";
$service = Get-Service W32Time;
$autoUpdate = Get-ItemProperty $timeZoneKey -Name $timeZoneOption;
$autoUpdate = (Get-Item $timeZoneKey).GetValue($timeZoneOption);
$stopped = ($service.Status -eq "Stopped");
$setUpdate = { param([int] $Value) Set-ItemProperty $timeZoneKey -Name $timeZoneOption $Value };