param( [DateTime]$StartTime, $SessionTitle="Session", $Speaker="Jeffrey") function Invoke-Display() { Invoke-Merlin $Message -Character (Get-RandomElement $Characters) ` -Size $CharacterSize ` -MoveToX $Random.Next(500) -MoveToY $Random.Next(500) ` -StartX $Random.Next(500) -StartY $Random.Next(500) Start-Sleep $SleepTime } function Get-RandomElement($Array) { $Array[ $Random.Next( $Array.Count ) ] } $Sleeptime = 10 $CharacterSize = 250 $WiseCracks=( "PowerShell Rocks baby", # I know that this is misspelled but it has to be to sound correct "Hay Hay, My My, the CLI will never die", "Powershell has a wicked pissa scripting language", "Powershell is wicked easy to use", "Powershell is like, ya know, wicked consistent", "puke monkey guts", "exchange uses powershell, so should you", "fish heads, fish heads, rolly polly fish heads, fish heads, fish heads, eat them up yumm","Jeffrey likes questions, ask them", "Powershell has direct support for WMI, ADO, ADSI, XML, COM, and .NET", "Shut up or I'll replace you with a 2 line Powershell script, , just joking", "PowerShell goes to 11", "triple panic abort" ) # Leverages the .NET Random number generator $Random=New-Object Random # Characters are found in .ACS files $Path = $(Join-Path $env:windir "msagent\chars\*.acs") $Characters=@(dir $Path | foreach {($_.Name.Split("."))[0]}) while ($True) { $till = $StartTime - [DateTime]::now if ($till.TotalSeconds -le 0) { # Now it is time to go so let's get it going $Message = "hay $Speaker, Start the session" $SleepTime = 10 $CharacterSize = 600 while ($true) { Invoke-Display } } $Message = "$SessionTitle will start in $($Till.Minutes) minutes and $($till.Seconds) seconds" Invoke-Display $Message = Get-RandomElement $WiseCracks Invoke-Display $Message = Get-RandomElement $WiseCracks Invoke-Display }