This tutorial will provide the usage of PowerShell’s “Get-TimeZone” cmdlet.
How to Use the PowerShell Get-TimeZone Cmdlet?
In Powershell, the “Get-TimeZone” cmdlet is used for displaying the time zone. To get the current time zone, simply execute the “Get-TimeZone” cmdlet in PowerShell.
Syntax
The syntax of the “Get-TimeZone” cmdlet is:
Example 1: Use the Cmdlet “Get-TimeZone” to Retrieve the Current Time Zone
Run the below-stated command to get the system’s current time zone:
Example 2: Use the Cmdlet “Get-TimeZone” to Retrieve the Time Zones Matching a Specified String
For getting the time zone that matches a particular string, first, use the “Get-TimeZone” cmdlet along with the “-Name” parameter and assign it the time zone enclosed within wild card characters:
Example 3: Use the “Get-TimeZone” Cmdlet to Retrieve the Available Time Zones
To retrieve all available time zones, first, use the “Get-TimeZone” cmdlet and then add the “-ListAvailable” parameter:
That’s it! You have learned the usage of the “Get-TimeZone” cmdlet in PowerShell.
Conclusion
The “Get-TimeZone” cmdlet is used to retrieve the current time zone in PowerShell. Moreover, it can also get the list of available and specified time zone. This article has elaborated on the use of PowerShell’s “Get-TimeZone” cmdlet.