This guide will explain the usage of PowerShell’s “Set-TimeZone” cmdlet.
How to Use the PowerShell’s Set-TimeZone Cmdlet?
With PowerShell’s “Set-TimeZone” cmdlet, a user can change the system time zone to a certain time zone. To do so, first, use the “Set-TimeZone” cmdlet and assign it the time zone name.
Syntax
Let’s have a look at the general syntax of the “Set-TimeZone” cmdlet in PowerShell:
Example 1: Use the “Set-TimeZone” Cmdlet to Set the Time Zone by ID
First, use the “Set-TimeZone” cmdlet. Then, specify the time zone by using the “-Id” parameter:
Example 2: Use the Cmdlet “Set-TimeZone” to Set the Time Zone by Name
First, use the cmdlet “Set-TimeZone” along with the parameter “-Name” and specify the time zone name. Lastly, use the parameter “-PassThru” at the end:
Example 3: Use the Cmdlet “Set-TimeZone” to List All Available Time Zones
To retrieve the available list of time zones, first, use the “Get-TimeZone” cmdlet. Then, assign the “-ListAvailable” parameter:
That’s it! We have described the usage of the “Get-TimeZone” cmdlet in PowerShell.
Conclusion
The “Set-TimeZone” cmdlet in PowerShell is used to change the system time zone to a given time zone. Simply pass the time zone name to the “Set-TimeZone” cmdlet to set the time zone to a certain time zone. This tutorial has explained the usage of the “Set-TimeZone” cmdlet with the help of various examples.