mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 09:28:21 +02:00
Improve list-voices.ps1
This commit is contained in:
parent
dd1a0ec7a0
commit
8063f4b08f
@ -11,13 +11,15 @@
|
|||||||
Author: Markus Fleschutz / License: CC0
|
Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -Version 2.0
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Voice = new-object -ComObject SAPI.SPVoice
|
add-type -AssemblyName System.Speech
|
||||||
$Voices = $Voice.GetVoices()
|
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
||||||
foreach ($OtherVoice in $Voices) {
|
$speak.GetInstalledVoices() |
|
||||||
$Description = $OtherVoice.GetDescription()
|
Select-Object -ExpandProperty VoiceInfo |
|
||||||
"* $Description"
|
Select-Object -Property Name, Culture, Gender, Age
|
||||||
}
|
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user