Fixed typo

This commit is contained in:
Markus Fleschutz 2020-12-31 09:51:42 +00:00
parent 943752b6b7
commit 21a23422e1

View File

@ -10,12 +10,12 @@ param([string]$File)
try {
if ($File -eq "") {
$File = read-host "Enter path to file"
$File = read-host "Enter path to text file"
}
$Text = Get-Content $File
$voice = New-Object ComObject SAPI.SPVoice
$voice.Speak($Text);
$Voice = new-object -ComObject SAPI.SPVoice
$Result = $Voice.Speak($Text)
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"