mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +01:00
Added speak-file.ps1
This commit is contained in:
parent
ec35a6cfb1
commit
fc03bc6e29
@ -1,7 +1,7 @@
|
||||
Collection of Useful PowerShell Scripts (CUPS)
|
||||
==============================================
|
||||
|
||||
This repository contains 40 useful cross-platform PowerShell scripts - to be used on the command-line (CLI), by context menu, by voice control, or by automation software (e.g. Jenkins).
|
||||
This repository contains 41 useful cross-platform PowerShell scripts - to be used on the command-line (CLI), by context menu, by voice control, or by automation software (e.g. Jenkins).
|
||||
|
||||
List of Scripts
|
||||
---------------
|
||||
@ -32,7 +32,8 @@ The following PowerShell scripts can be found in the `Scripts/` subfolder:
|
||||
* [SHA1.ps1](Scripts/SHA1.ps1) - prints the SHA1 checksum of the given file
|
||||
* [SHA256.ps1](Scripts/SHA256.ps1) - prints the SHA256 checksum of the given file
|
||||
* [simulate-presence.ps1](Scripts/simulate-presence.ps1) - simulates the human presence against burglars
|
||||
* [speak.ps1](Scripts/speak.ps1) - speaks the given text by text-to-speech (TTS)
|
||||
* [speak-file.ps1](Scripts/speak-file.ps1) - speaks the content of the given text file by text-to-speech (TTS)
|
||||
* [speak-text.ps1](Scripts/speak-text.ps1) - speaks the given text 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
|
||||
|
21
Scripts/speak-file.ps1
Executable file
21
Scripts/speak-file.ps1
Executable file
@ -0,0 +1,21 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./speak-file.ps1 [<file>]
|
||||
# Description: speaks the content of the given text file by text-to-speech (TTS)
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
param([string]$File)
|
||||
if ($File -eq "") {
|
||||
$File = read-host "Enter path to file"
|
||||
}
|
||||
|
||||
try {
|
||||
$Text = Get-Content $File
|
||||
|
||||
$voice = New-Object ComObject SAPI.SPVoice
|
||||
$voice.Speak($Text);
|
||||
exit 0
|
||||
} catch { Write-Error $Error[0] }
|
||||
exit 1
|
@ -1,7 +1,7 @@
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./speak.ps1 [<text>]
|
||||
# Description: speaks the given text
|
||||
# Syntax: ./speak-text.ps1 [<text>]
|
||||
# Description: speaks the given text by text-to-speech (TTS)
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
Loading…
Reference in New Issue
Block a user