diff --git a/Docs/VoiceControl.md b/Docs/VoiceControl.md index f4f34510..4559177d 100644 --- a/Docs/VoiceControl.md +++ b/Docs/VoiceControl.md @@ -97,7 +97,7 @@ Computer, open `name` settings Computer, check `name` ---------------------- * let the computer check something. -* replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", or "up-time". +* replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", "timezone", or "up-time". 🔊 Audio diff --git a/Scripts/check-timezone.ps1 b/Scripts/check-timezone.ps1 new file mode 100755 index 00000000..2a6172c2 --- /dev/null +++ b/Scripts/check-timezone.ps1 @@ -0,0 +1,23 @@ +<# +.SYNOPSIS + Determines the time zone +.DESCRIPTION + This script determines and returns the current time zone. +.EXAMPLE + PS> ./check-timezone +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $TimeZone = (Get-Timezone) + $Reply = "It's $($TimeZone.DisplayName)" + "✔️ $Reply" + & "$PSScriptRoot/speak-english.ps1" "$Reply" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}