mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 08:23:14 +01:00
Added speak-time.ps1
This commit is contained in:
parent
31848acec0
commit
9f7552b386
@ -60,6 +60,7 @@ simulate-presence.ps1, simulates the human presence against burglars
|
||||
speak-file.ps1, speaks the content of the given text file by text-to-speech (TTS)
|
||||
speak-test.ps1, performs a speak test by text-to-speech (TTS)
|
||||
speak-text.ps1, speaks the given text by text-to-speech (TTS)
|
||||
speak-time.ps1, speaks the current time by text-to-speech (TTS)
|
||||
switch-shelly1.ps1, switches a Shelly1 device in the local network
|
||||
take-screenshot.ps1, takes a single screenshot
|
||||
take-screenshots.ps1, takes multiple screenshots
|
||||
|
|
@ -1,7 +1,7 @@
|
||||
Collection of Useful PowerShell Scripts
|
||||
=======================================
|
||||
|
||||
This repository contains 80+ useful and cross-platform PowerShell scripts - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software (e.g. Jenkins), or simply to learn PowerShell.
|
||||
This repository contains 90+ useful and cross-platform PowerShell scripts - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software (e.g. Jenkins), or simply to learn PowerShell.
|
||||
|
||||
List of Scripts
|
||||
---------------
|
||||
@ -68,6 +68,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
|
||||
* [speak-file.ps1](Scripts/speak-file.ps1) - speaks the content of the given text file by text-to-speech (TTS)
|
||||
* [speak-test.ps1](Scripts/speak-test.ps1) - performs a speak test by text-to-speech (TTS)
|
||||
* [speak-text.ps1](Scripts/speak-text.ps1) - speaks the given text by text-to-speech (TTS)
|
||||
* [speak-time.ps1](Scripts/speak-time.ps1) - speaks the current time by text-to-speech (TTS)
|
||||
* [switch-shelly1.ps1](Scripts/switch-shelly1.ps1) - switches a Shelly1 device in the local network
|
||||
* [take-screenshot.ps1](Scripts/take-screenshot.ps1) - takes a single screenshot
|
||||
* [take-screenshots.ps1](Scripts/take-screenshots.ps1) - takes multiple screenshots
|
||||
|
17
Scripts/speak-time.ps1
Normal file
17
Scripts/speak-time.ps1
Normal file
@ -0,0 +1,17 @@
|
||||
#!/snap/bin/powershell
|
||||
<#
|
||||
.SYNTAX ./speak-time.ps1
|
||||
.DESCRIPTION speaks the current time by text-to-speech (TTS)
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$Voice = new-object -ComObject SAPI.SPVoice
|
||||
$Text = "The current time is $((Get-Date).ToShortTimeString())"
|
||||
$Result = $Voice.Speak($Text)
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user