mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Improved the scripts
This commit is contained in:
@ -9,11 +9,20 @@
|
||||
function Speak([string]$Text) {
|
||||
write-progress "$Text"
|
||||
$Voice = new-object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -like "*- English (United States)") {
|
||||
$Voice.Voice = $OtherVoice
|
||||
break
|
||||
}
|
||||
}
|
||||
[void]$Voice.Speak($Text)
|
||||
write-progress -complete "$Text"
|
||||
}
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
|
||||
Speak("It's now $((Get-Date).ToShortTimeString())")
|
||||
exit 0
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user