My Computer Talks

I was exposed to a VBScript recently that had code to make the computer speak with the Microsoft Speech API.

Being the weirdo I am, I wanted to make a PowerShell version of this script, so I did.

$engine=new-object -comobject sapi.spvoice
$username=[Environment]::UserName
$speech="Hi, $username"
$engine.Speak($speech)

The $speech variable above can be any text. In my test, I had a job description there. In other testing, I had it read the content of a text file by using the get-content cmdlet.

Leave a Reply