Invoke-Speak

Invoke-Speak

Speak with Microsoft Speech using PowerShell

by Michael J. Thomas


So, it's time again for a cool little script that you can use and have some fun with your co-workers.
Warning, using this code inappropriately can lead to disciplinary actions by your employer. 
Code Wisely my Friends




<#
.Synopsis
   Invoke-Speak
   Created by Michael J. Thomas
   Date:    06/15/2019
   Updated: 06/15/2019

.DESCRIPTION
    Invoke-Speak allows you to speak to a remote computer with Microsoft Speach
    Invoke-Speak -Words $Words -ComputerName $Computers -Speed (-10 to 10) Slow to Fast
    Default Speed is 2.
    
.EXAMPLE
   Invoke-Speak "Hello World!"
   Invoke-Speak "Hello World! -ComputerName "Computer01", "Computer02" -Speed 2
#>

function Invoke-Speak{
[cmdLetBinding()]
Param(
[string]$Words,
[string[]]$ComputerName =$env:COMPUTERNAME,
[int]$Speed = 2
)

Foreach ($Computer in $ComputerName){
Invoke-Command -ComputerName $Computer -ScriptBlock{
Add-Type -AssemblyName System.Speech
$Speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$Speak.Rate = $Using:Speed
$Speak.Speak($Using:Words)
$Speak.Dispose()
}
}

}


#Subscribe to PowerShell Weekly

Comments

  1. We use the most recent additive manufacturing know-how to build reasonably priced practical components in over 60 metals and plastics. We use industrial and industrial-grade printers similar to Stratasys Fortus 900mc and Fortus 450 FDM, EOS Polymer Laser Sintering and DMLS, Concept Laser, SLM Solutions, 3D Systems, ExOne, and extra. For a great introduction to additive manufacturing, please visit ourComplete Guide to 3D Printing. Stereolithography , direct mild processing and continuous direct mild processing are additive manufacturing processes that fall under the class of vat photopolymerization. In SLA, an object is created by selectively curing a polymer resin layer-by-layer using an ultraviolet laser beam. DLP is much like SLA however makes use of a digital mild projector screen to flash a single picture of Bike Helmets every layer all of sudden.

    ReplyDelete

Post a Comment

Popular posts from this blog

Add-RemoteDesktopUsers

Install Admin Pack on Remote Computer

Invoke-Reprofile