Pluralsight is celebrating its 10th birthday today. As part of their celebration they are running a quick contest with a cool prize. They also asked authors for a birthday greeting or message. Since all of my courses are PowerShell related it seemed only fitting to do something like this:
Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
Sure, hardly a practical use of PowerShell but it sure was fun to put together. Here is the script I ran.
cls
Function PauseIt {
[cmdletbinding()]
Param()
Write-Verbose "PauseIt"
#wait for a key press
$Running=$true
#keep looping until a key is pressed
While ($Running) {
if ($host.ui.RawUi.KeyAvailable) {
$key = $host.ui.RawUI.ReadKey("NoEcho,IncludeKeyDown")
if ($key) {
$Running=$False
#check the value and if it is q or ESC, then bail out
if ($key -match "q|27") {
Write-Host "`r"
Return "quit"
} #if match q|27
} #if $key
} #if key available
Start-Sleep -millisecond 100
} #end While
} #PauseIt function
Function TypeLine {
Param(
[string]$Text,
[switch]$NoPrompt
)
If (-Not $NoPrompt) {
Write-Host "PS C:\> " -NoNewline
}
$text.ToCharArray() | foreach {
Write-host $_ -NoNewline
start-sleep -Milliseconds (Get-Random -Minimum 50 -max 100)
}
}
Write-Host "PS C:\> " -NoNewline
PauseIt
$v = new-object -ComObject Sapi.SPVoice
$v.Speak("Hello, and welcome to my world.") | out-Null
$Line = '$colors = [enum]::GetNames([consolecolor]) | where {$_ -ne $host.ui.RawUI.BackgroundColor}'
TypeLine $line -NoPrompt
Invoke-Expression $line
"`r"
$v.Speak("I have a special message.") | out-Null
$Line = '$msg="Happy Birthday, Pluralsight!"'
TypeLine $line
$v.Speak("And a special way to say it, thanks to Jeff.") | out-Null
Invoke-Expression $line
"`r"
$Line = '$msg.ToCharArray() | foreach { write-host $_ -NoNewline -ForegroundColor (Get-Random $colors) -BackgroundColor (Get-Random $colors)} -end {"`n"}'
TypeLine $line
"`r"
Invoke-Expression $line
"`r"
$v.speak("Happy Birthday, Pluralsight. Now, where's the cake?") | Out-Null
$line = 'Get-Smarter -path Pluralsight -Subject PowerShell | Where {$_.trainer -eq "Jeff Hicks"}'
TypeLine $line
"`r"
Write-Host 'Success'
Write-Host "PS C:\>" -NoNewline
"`r"
No puppies were harmed in the making of this video. Enjoy and Happy Birthday!

Nice one Jeff, now where do I download that get-smarter module to upgrade my brain, and should it go in my PowerShell profile to reload it every morning upon wake up?