Tuesday, November 04, 2008

A Day at Tech-Ed the PowerShell Way

Start-Service $body

Set-Location $bathroom
Clear-Item $body

Set-Location $restaurant
Get-Item $breakfast | Format-table | Add-Content $body

Set-Location $bathRoom
$body.oldFood | Out-Null
Clear-ItemProperty $body teeth

Set-Location $desk
$today=(Get-Date).Date
$potentialSessions=Get-ChildItem $sessions | `
Where {$_.description -gt $interest -and $_.date -eq $today} | foreach {
$_ | Add-Member Noteproperty Priority (read-host "Priority") -Passthru
} | where {$_.priority}
$plannedSessions=$potentialSessions | group timeslot | foreach {
$_.group | sort priority | select -first 1
}

Set-Location $conferenceCenter
$informationOverload=$false
$plannedSessions | foreach {
if ($informationOverload) {
Start-Sleep -Minutes 90
$informationOverload=$false
}
else {
Invoke-Item $_ | where {$_.content -notlike "sales pitch"} | `
Add-Content -path $body.brain
}
[void] (Start-Sleep -Minutes 30) -and (Add-Content $body $coffee)
if ($body.brain.overloaded) {$informationOverload=$true}
}

Set-Location ($anywhere | where {$_.beerCount -gt 5 -and $_.price -eq $null} | select -first 1)
while ($body.thirsty -and $body.alcoholPercentage -lt 1.5) {
Add-Content $body $beer
}

Set-Location $hotelRoom
Start-Sleep -minutes (60*7)

# See you tomorrow ;)


2 comments:

Unknown said...

Per - you have a twisted mind ;-)

Anonymous said...

Super cool :))

David