Added list-timezones.ps1

This commit is contained in:
Markus Fleschutz 2021-01-12 14:38:18 +01:00
parent 138a0d2b20
commit 92634a3cf9
3 changed files with 17 additions and 0 deletions

View File

@ -40,6 +40,7 @@ list-processes.ps1, lists the local computer processes
list-random-passwords.ps1, prints a list of random passwords
list-random-pins.ps1, prints a list of random PIN's
list-scripts.ps1, lists the PowerShell scripts in this repository
list-timezones.ps1, lists all timezones available
locate-city.ps1, prints the geographic location of the given city
locate-ipaddress.ps1, prints the geographic location of the given IP address
locate-zip-code.ps1, prints the geographic location of the given zip-code

1 Filename Description
40 list-random-passwords.ps1 prints a list of random passwords
41 list-random-pins.ps1 prints a list of random PIN's
42 list-scripts.ps1 lists the PowerShell scripts in this repository
43 list-timezones.ps1 lists all timezones available
44 locate-city.ps1 prints the geographic location of the given city
45 locate-ipaddress.ps1 prints the geographic location of the given IP address
46 locate-zip-code.ps1 prints the geographic location of the given zip-code

View File

@ -48,6 +48,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
* [list-random-passwords.ps1](Scripts/list-random-passwords.ps1) - prints a list of random passwords
* [list-random-pins.ps1](Scripts/list-random-pins.ps1) - prints a list of random PIN's
* [list-scripts.ps1](Scripts/list-scripts.ps1) - lists the PowerShell scripts in this repository
* [list-timezones.ps1](Scripts/list-timezones.ps1) - lists all timezones available
* [locate-city.ps1](Scripts/locate-city.ps1) - prints the geographic location of the given city
* [locate-ipaddress.ps1](Scripts/locate-ipaddress.ps1) - prints the geographic location of the given IP address
* [locate-zip-code.ps1](Scripts/locate-zip-code.ps1) - prints the geographic location of the given zip-code

15
Scripts/list-timezones.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/snap/bin/powershell
<#
.SYNTAX ./list-timezones.ps1
.DESCRIPTION lists all timezones available
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
get-timezone -listavailable | format-table -property Id,DisplayName,SupportsDaylightSavingTime
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}