Skip to content

Spell-Word

Spells a word

param([string]$word = "")

try {
	if ($word -eq "" ) { $word = Read-Host "Enter the word to spell" }

	[char[]]$array = $word.ToUpper()
	$reply = ""
	foreach($char in $array) {
		$reply += $char + ", "
	}
	& "$PSScriptRoot/speak-english.ps1" $reply
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
        exit 1
}

Specifies the word to spell (queried by default)

An interactive directory of PowerShell scripts.