Skip to content

Instantly share code, notes, and snippets.

@rodcordeiro
Last active October 23, 2025 21:23
Show Gist options
  • Select an option

  • Save rodcordeiro/b33decdc547b7d7c129eb1b120ea0e15 to your computer and use it in GitHub Desktop.

Select an option

Save rodcordeiro/b33decdc547b7d7c129eb1b120ea0e15 to your computer and use it in GitHub Desktop.
function Invoke-TextToSpeech {
param(
[Parameter(Mandatory, ValueFromRemainingArguments)]
[string[]]$texto
)
begin {
Add-Type -AssemblyName System.speech
$narrador = New-Object System.Speech.Synthesis.SpeechSynthesizer
}
process {
$narrador.Speak($texto -join " ")
$narrador.Dispose()
}
}
Set-Alias tts Invoke-TextToSpeech
$Host.UI.RawUI.BackgroundColor = "Green"
$Host.UI.RawUI.ForegroundColor = "White"
Clear-Host # Clears the console to apply the new background color
tts Esse é o script do meu pau!
tts Viu que legal?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment