Update list-voices.ps1

This commit is contained in:
Markus Fleschutz 2021-10-07 11:27:34 +02:00 committed by GitHub
parent d92d477f9a
commit 00eaa9b4a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,8 @@
<#
.SYNOPSIS
Lists the installed text-to-speech (TTS) voices
Lists the installed text-to-speech voices
.DESCRIPTION
list-voices.ps1
This script lists the installed text-to-speech voices. It requires PowerShell 2.0 or higher.
.EXAMPLE
PS> ./list-voices
@ -22,9 +22,8 @@ try {
Add-Type -AssemblyName System.Speech
$Synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$Synth.GetInstalledVoices() |
Select-Object -ExpandProperty VoiceInfo |
Select-Object -Property Name, Culture, Gender, Age
Select-Object -ExpandProperty VoiceInfo |
Select-Object -Property Name, Culture, Gender, Age
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"