Created
March 24, 2020 19:27
-
-
Save gabriel-lopez/419c236654c038c3d72060d2797f6edc to your computer and use it in GitHub Desktop.
Update computer time using worldtimeapi.org API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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