Softstuff Consulting
My occasional musings of a technical nature
  • Send us a message
  • About Softstuff Consulting
  • Privacy Policy
  • Main Website
Powershell , Windows

How to make your Powershell scripts more annoying

by Ian Blair January 27, 2021 No Comments

Have you ever wished when you are running a long complicated powershell script that you could make it more annoying.

Well you can.

There is a part of .NET that I have rarely ever had reason to use, as if you are creating an interface and need it to be disability friendly then Windows does all the heavy lifting for you. .NET comes with a speech synthesiser.

All you need to do is add the following lines to the start of your powershell script

Add-Type -AssemblyName System.Speech
$speech=new-object System.Speech.Synthesis.SpeechSynthesizer

The each time you want something to be said you can call either

$speech.Speak("Open the pod bay doors hal")

This will halt the script while the sentence is spoken, or if you prefer an asynchronous version then use this

$speech.SpeakAsync("Set the controls for the heart of the sun")

A simple way to make your powershell scripts either more interesting or more annoying depending on your point of view.

There are other options like changing the age of the voice, or the gender, or even the voice itself and perhaps I might write another article going into things a little more deeply, but for now letting my PC nag me is quite enough.

 

  • Previous What motherboard is in my PC4 years ago

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to make your Powershell scripts more annoying
  • What motherboard is in my PC
  • A Dynamics365 plugin thought experiment
  • Registering a Dynamics365 plugin and I get an error
  • Going back in time with Dynamics365

Categories

  • Bootstrap
  • C#
  • CSS
  • Dot Net Core
  • Dynamics365
  • JavaScript
  • Powershell
  • T-SQL
  • Thoughts
  • VBScript
  • Visual Studio
  • Windows
  • Xamarin

Recent Comments

  • S0ftStuffB055 on Call a Dynamics365 workflow from JavaScript
  • Siva on Call a Dynamics365 workflow from JavaScript
  • TC Sharpe on Throw exceptions in Dynamics365 workflow plugins, or don’t
  • BigOwl on Throw exceptions in Dynamics365 workflow plugins, or don’t
  • CRMGod on Access a Dynamics365 embedded webresource

Archives

  • January 2021
  • May 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • June 2019
  • May 2019
  • February 2019
2025 Softstuff Consulting. Donna Theme powered by WordPress
  • Twitter