forked from fleschutz/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeak-checklist.ps1
More file actions
executable file
·36 lines (32 loc) · 941 Bytes
/
speak-checklist.ps1
File metadata and controls
executable file
·36 lines (32 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<#
.SYNOPSIS
Speaks a checklist by text-to-speech
.DESCRIPTION
This PowerShell script speaks the given checklist by text-to-speech (TTS).
.PARAMETER Name
Specifies the name of the checklist
.EXAMPLE
PS> ./speak-checklist
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz / License: CC0
#>
param([string]$Name = "")
try {
if ($Name -eq "") { $Name = read-host "Enter the name of the checklist" }
$Lines = Get-Content -path "$PSScriptRoot/../Data/Checklists/$Name.txt"
clear-host
$Step = 1
foreach($Line in $Lines) {
if ($Line -like "HEAD*") { & "$PSScriptRoot/write-big.ps1" "$($Line.substring(5))"; continue }
""
& "$PSScriptRoot/give-reply.ps1" "$($Step). $Line"
$Dummy = read-host " Say <Check> or press <Return> to continue"
$Step++
}
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}