PowerShell Function: Out-Speaker

Here is a quick PowerShell Function that can be used to display read output via the speaker.

   1:  function Out-Speaker ([Parameter(Mandatory=$true,ValueFromPipeline=$true,ValuefromPipelinebyPropertyName=$true)][string]$Output) {
   2:      $Speaker = New-Object -comObject SAPI.SpVoice
   3:      $Speaker.Speak($output) | Out-Null
   4:  }
   5:  # Example - Uncomment and run to hear the example
   6:  # $Processes = (Get-Process).Count
   7:  # "There are $Processes processes running on your computer" | Out-Speaker

Popular posts from this blog

Get local computer UUID/GUID using Windows Powershell

gPLink and gPOptions

PSLoggedOn Getting Started on Windows Server 2008 R2