mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 10:59:14 +01:00
Rename to check-date.ps1 and check-time.ps1
This commit is contained in:
parent
372e773c12
commit
a959f51ce6
@ -97,7 +97,7 @@ Computer, open `name` settings
|
||||
Computer, check `name`
|
||||
----------------------
|
||||
* let the computer check something.
|
||||
* replace `name` by: "CPU", "DNS", "operating system", "ping", "swap space", or "up-time".
|
||||
* replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", or "up-time".
|
||||
|
||||
|
||||
🔊 Audio
|
||||
|
@ -22,8 +22,6 @@ Mega Collection of PowerShell Scripts
|
||||
| [play-mp3.ps1](Scripts/play-mp3.ps1) | Plays the given sound file (MP3 file format) | [Help](Docs/play-mp3.md) |
|
||||
| [play-super-mario.ps1](Scripts/play-super-mario.ps1) | Plays the Super Mario Intro | [Help](Docs/play-super-mario.md) |
|
||||
| [play-tetris-melody.ps1](Scripts/play-tetris-melody.ps1) | Plays the Tetris melody | [Help](Docs/play-tetris-melody.md) |
|
||||
| [say-date.ps1](Scripts/say-date.ps1) | Say the current date by text-to-speech | [Help](Docs/say-date.md) |
|
||||
| [say-time.ps1](Scripts/say-time.ps1) | Say the current time by text-to-speech | [Help](Docs/say-time.md) |
|
||||
| [speak-checklist.ps1](Scripts/speak-checklist.ps1) | Speaks the given checklist by text-to-speech | [Help](Docs/speak-checklist.md) |
|
||||
| [speak-countdown.ps1](Scripts/speak-countdown.ps1) | Starts a countdown by text-to-speech | [Help](Docs/speak-countdown.md) |
|
||||
| [speak-english.ps1](Scripts/speak-english.ps1) | Speaks the given text with an English text-to-speech voice | [Help](Docs/speak-english.md) |
|
||||
|
@ -1,11 +1,11 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Say the current date by text-to-speech
|
||||
Determines the current date
|
||||
.DESCRIPTION
|
||||
This script speaks the current date by text-to-speech (TTS).
|
||||
This script determines and speaks the current date by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./say-date
|
||||
(It's Sunday, October 17, 2021)
|
||||
PS> ./check-date
|
||||
✔️ It's Sunday, October 17, 2021
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
@ -16,9 +16,9 @@ try {
|
||||
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
|
||||
$Weekday = (Get-Date -format "dddd")
|
||||
$CurrentDate = (Get-Date).ToShortDateString()
|
||||
$Answer = "It's $Weekday, $CurrentDate"
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||
write-output "$Answer"
|
||||
$Reply = "It's $Weekday, $CurrentDate"
|
||||
"✔️ $Reply"
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
@ -1,11 +1,10 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Say the current time by text-to-speech
|
||||
Determines the current time
|
||||
.DESCRIPTION
|
||||
This script speaks the current time by text-to-speech (TTS).
|
||||
This script determines and speaks the current time by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./say-time
|
||||
(It's 2:23 PM)
|
||||
PS> ./check-time
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
@ -15,9 +14,9 @@
|
||||
try {
|
||||
[system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US"
|
||||
$CurrentTime = $((Get-Date).ToShortTimeString())
|
||||
$Answer = "It's $CurrentTime"
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||
write-output "$Answer"
|
||||
$Reply = "It's $CurrentTime"
|
||||
"✔️ $Reply"
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
Loading…
Reference in New Issue
Block a user