Have PowerShell Cheer You Up!

by Aug 11, 2014

All PowerShell versions

Writing PowerShell code is fun but can be frustrating at times. Here’s a function that makes PowerShell cheer you up. Just turn on your sound, and PowerShell will comment each command with a new remark.

function prompt 
{
  $text = 'You are great!', 'Hero!', 'What a checker you are.', 'Champ, well done!', 'Man, you are good!', 'Guru stuff I would say.', 'You are magic!'
  'PS> '
  $host.UI.RawUI.WindowTitle = Get-Location
  (New-Object -ComObject Sapi.SpVoice).Speak(($text | Get-Random))
}

Twitter This Tip! ReTweet this Tip!