mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-06 16:44:58 +02:00
Add check-christmas.ps1 and check-new-year.ps1
This commit is contained in:
parent
3e72ee7e3c
commit
42ef987d69
@ -25,7 +25,7 @@ More supported voice commands are:
|
|||||||
|
|
||||||
`Computer, check` [name]
|
`Computer, check` [name]
|
||||||
------------------------
|
------------------------
|
||||||
Lets the computer check something, replace [name] by: `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `headlines`, `Moon`, `operating system`, `ping`, `Sun`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
Lets the computer check something, replace [name] by: `Christmas`, `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `headlines`, `Moon`, `New Year`, `operating system`, `ping`, `Sun`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
||||||
|
|
||||||
|
|
||||||
`Computer, open` [name] `browser`
|
`Computer, open` [name] `browser`
|
||||||
|
25
Scripts/check-christmas.ps1
Normal file
25
Scripts/check-christmas.ps1
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the time until Christmas
|
||||||
|
.DESCRIPTION
|
||||||
|
This script checks the time until Christmas and replies by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-christmas
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Now = [DateTime]::Now
|
||||||
|
$Diff = [Datetime]("12/25/" + $Now.Year) – $Now
|
||||||
|
|
||||||
|
$Reply = "$($Diff.Days) days until Christmas."
|
||||||
|
"✔️ $Reply"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
exit 1
|
||||||
|
}
|
25
Scripts/check-new-year.ps1
Normal file
25
Scripts/check-new-year.ps1
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the time until New Year
|
||||||
|
.DESCRIPTION
|
||||||
|
This script checks the time until New Year and replies by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-new-year
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Now = [DateTime]::Now
|
||||||
|
$Diff = [Datetime]("12/31/" + $Now.Year) – $Now
|
||||||
|
|
||||||
|
$Reply = "$($Diff.Days) days until New Year."
|
||||||
|
"✔️ $Reply"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user