Anyway, to that end, I present the following little ditty, a function I like to call Speak-String (which I usually alias to "say"), inspired by a few posts using the same trick that I've come across on the Internet.
function Speak-String([string]$message) {
$speaker = new-object -com SAPI.SpVoice
$speaker.Speak($message, 1)
}
Set-Alias say 'Speak-String'
PS C:\> Say "Would you like to play a game?"
PS C:\> Say "How about Global Thermonuclear War?"
No comments:
Post a Comment