Skip to content

Instantly share code, notes, and snippets.

@gabriel-lopez
Created March 24, 2020 19:27
Show Gist options
  • Select an option

  • Save gabriel-lopez/419c236654c038c3d72060d2797f6edc to your computer and use it in GitHub Desktop.

Select an option

Save gabriel-lopez/419c236654c038c3d72060d2797f6edc to your computer and use it in GitHub Desktop.
Update computer time using worldtimeapi.org API
# Ensures that Invoke-WebRequest uses TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$json = Invoke-WebRequest 'http://worldtimeapi.org/api/timezone/Europe/Zurich' | ConvertFrom-Json
set-date -date $json.datetime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment