-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invoke-SHDReadAloud.ps1
36 lines (35 loc) · 1.15 KB
/
Invoke-SHDReadAloud.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function Invoke-SHDReadAloud {
<#
.SYNOPSIS
Reads a list of strings out loud.
.DESCRIPTION
Reads a list of strings out loud.
.PARAMETER Message
The list of strings you wish to be read outloud with the standard voice.
.EXAMPLE
PS> Get-SHDReadALoud -Message "We're No strangers to love","You know the rules and so do I","A full commitment's what I'm thinking of","You wodln't get this from any other guy"
.INPUTS
List of strings
.OUTPUTS
Sound
.NOTES
Author: David Bolding
Date: 10/15/2020
.LINK
https://github.com/rndadhdman/PS_Super_Helpdesk
#>
[cmdletbinding()]
param (
[Parameter(
ValueFromPipeline = $True,
ValueFromPipelineByPropertyName = $True,
HelpMessage = "Read This Message",
Mandatory = $true)][Alias('Words', 'Speech')][String[]]$Message
)
add-type -assemblyname system.speech
$talk = new-object System.Speech.Synthesis.SpeechSynthesizer
foreach ($Item in $Message) {
$talk.Speak($Item)
start-sleep -Seconds 2
}
}