Skip to content

Speak-Countdown

Speaks a countdown by text-to-speech

#requires -version 5.1

param([int]$startNumber = 10)

try {
	for ([int]$i = $startNumber; $i -gt 0; $i--) {
		& "$PSScriptRoot/speak-english.ps1" $i
		Start-Sleep -milliseconds 200
	}
	& "$PSScriptRoot/speak-english.ps1" "Zero and lift-off!"
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
	exit 1
}

Specifies the number to start from (10 by default)

An interactive directory of PowerShell scripts.