James O'Neill's Blog

July 12, 2008

You know you have been doing too much PowerShell when you translate Macbeth …

Filed under: General musings,Powershell — jamesone111 @ 12:29 pm

When you wake up with Powershell in your head for things which are not scripting tasks, as I did this morning, you being to thing I need a holiday, or perhaps “Get-Vacation -days 7”


It stated with the thought that Waiting for Godot could be one line of PowerShell


$characters=get-tramps -count 2 ; while ($characters -notContains “Godot”) { Start-sleep 1000}


Which is all very well. But it’s gone too far when you find you can do MacBeth in one screen of PowerShell

 

$Sisters = Get-Witch

$Duncan = Get-King

$Macbeth = Get-Noble | where{$_.titles -contains “Thane of Glamis”}

$Banquo = $Macbeth.Friends[0]

$Battle1 = New-Rebellion -leader (get-noble | where{$_.name -eq “MacDonwald”})

$Battle1.add $Macbeth, $Banquo

$Battle1.Leader | kill

$Macbeth.Kills ++

$Battle1 | stop-process -passthru | out-King

$Battle2 = new-rebellion -leader (get-noble | where{$_.titles -contains “Thane of Cawdor”} )

$Battle2.add $Macbeth, $Banquo

$Battle2 | stop-process -passthru | out-King

Get-Noble | where {$_.titles -contains “Thane of Cawdor”} | Kill

Set-location heath:

$sisters | forEach {$MacBeth.FutureStates += $_.prophecy() }

$sisters | forEach {$Banquo.FutureStates += $_.prophecy() }

$Macbeth.Titles += “Thane of Cawdor”

$Macbeth.State = “Amazed”

Set-location Hill:Dunsinane\Castle

$MacBeth.FutureStates | out-Hostess

$Macbeth.Wife.CreatePlot $Duncan $MacBeth [Weapon]”Dagger” Hill:Dunsinane\Castle\BedChamber

$MacDuff = Get-nobles where {$_.titles -contains “Thane of Fife”}

$Malcolm = $Duncan.Sons[0]

$Malcolm.Titles += “Price of Cumberland”

$Duncan.State = “Sleeping”

$Duncan | kill

Move $MacDuff Hill:Dunsinane\Castle\BedChamber

$Duncan.state | out-hostess

$MacBeth.wife.state = “Fainted”

$Duncan.sons | foreach {$_.visible = $false }

$MacDuff.Visible = $false

New-King $MacBeth

$Assassins = Get-Murderer

$Assassins.targets += $Banquo

$Assassins.targets += $Banquo.sons

$Banquo | kill -passthru

$Banquo.sons[0].visible = $false

$Banquo.visible = $True

$MacBeth.State = “Terrified”

$Banquo.visible = $False

$Sisters | forEach {$MacBeth.FutureStates += $_.prophecy() }

$MacDuff.Wife | kill

$MacDuff.sons | foreach {kill $_}

$MacDuff.daughters | foreach {kill $_}

$MacBeth.wife.State = “Mad”

$MacBeth.wife.terminate

Move-item Wood:Birnam -Destination Hill:Dunsinane

$MacDuff.Visible = $True

$Battle3 = New-Rebellion -leader $MacDuff,$Malcolm

$MacDuff.NaturalChildBirth = $False

$MacBeth | Kill

New-king $Malcolm


Richard, Jonathan, Jeffrey, Dmitry   what else can you come up with ?  Actually I’ll offer a “Heroes Happen Here” book* to anyone who doesn’t have one who can post a decent stab at this – doesn’t have to be Shakespeare (War and Peace might be a bit much)


What next Oscar Wilde in Perl ? Star-Wars in VBscript ?


(*While Stocks last. One Per house hold. Void where prohibitted. May contain nuts).


Technorati Tags:

This post originally appeared on my technet blog.

Advertisements

Blog at WordPress.com.

%d bloggers like this: