mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Update spell-word.ps1
This commit is contained in:
parent
58e769b940
commit
e188da6c5e
@ -3,6 +3,8 @@
|
||||
Spells a word
|
||||
.DESCRIPTION
|
||||
This script spells the given word by text-to-speech (TTS).
|
||||
.PARAMETER word
|
||||
Specifies the word to spell
|
||||
.EXAMPLE
|
||||
PS> ./spell-word
|
||||
.NOTES
|
||||
@ -11,7 +13,20 @@
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
$Reply = "T E S T"
|
||||
param([string]$word = "")
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
try {
|
||||
if ($word -eq "" ) { $word = read-host "Enter word to spell" }
|
||||
|
||||
[char[]]$ArrayOfChars = $word.ToUpper()
|
||||
$Reply = ""
|
||||
foreach($Char in $ArrayOfChars) {
|
||||
$Reply += $Char
|
||||
$Reply += " "
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user