title: Powershell showing old time after changing the time zone
body: <p>Here's my powershell script: </p>
  
  <pre><code>$time = (Get-Date).ToShortTimeString()
  Write-Host "Current Time: "$time
  $destzone = [System.TimeZoneInfo]::FindSystemTimeZoneById("Central Standard Time")
  $desttime = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), $destzone)
  $desttime = $desttime.ToShortTimeString()
  Write-Host "UTC-6 = "$desttime
  $newtime = (Get-Date).ToShortTimeString()
  Write-Host "Current Time: "$newtime
  if($newtime -eq $desttime)
  {
  Write-Host "ok"
  }else
  {
  C:\Windows\System32\tzutil.exe /s "Central Standard Time"
  }
  </code></pre>
  
  <p>What I am trying to achieve is that</p>
  
  <ol>
  <li>Get current system time</li>
  <li>Compare it with the Universal Time (utc-6)</li>
  <li>If it's the same then there is nothing to be done. If not, change system time zone to utc-6</li>
  </ol>
  
  <p>Everything works, but once after setting the system time zone to utc-6, when I checks the current system time, it shows me the old time itself (though I can see that the system time zone has changed)</p>
  
  <p>Looks like something like caching. Is there anything like that? Or Is there anything wrong with my script?</p>
  
  <p>Can someone please lead me through a good way?</p>