James O'Neill's blog

Windows Platform, Virtualization and PowerShell with a little Photography for good measure.

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

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

  • Comments 7
  • Likes

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:
Comments
  • Finally a chance to use my MFA and do PowerShell. I may have to do a more complete Godot. But how about Beckett's Breath?  

    http://en.wikipedia.org/wiki/Breath_(play)

    One of my favorites.

    $stage=Get-Stage

    Stage.litter=100

    stage.light=25

    Get-Sound -name "infantCry" -duration 2

    stage.light=50

    get-sound -name "breathing" -duration 20

    for ($i=1;$i -lt 10;$i++) {

     stage.light++

    }

    for ($i=1;$i -lt 10;$i++) {

     stage.light--

    }

    Get-Sound -name "InfantCry" -duration 3

    stage.light.fade(3)

  • Infinitely refreshing to see PowerShell jumping out of the box !!

  • James O'Neill got it into his head that he could translate literature into PowerShell. He has a hilarious

  • I'm not one to shy away from a challenge, but all I can manage at the moment is...

    $catch = 22

    switch ($catch)

    {

     22 {"You lose"}

     default {"You lose"}

    }

    By the way James, I heard a pub-quiz-style factoid the other week that I thought you'd like: The Royal Flying Corps officer who buried the 'Red Baron', Gladstone Adams, was also the man who patented the windscreen wiper. You never know when that information might come in handy! ;-)

  • Here you go :)

    http://dmitrysotnikov.wordpress.com/2008/07/14/powershell-hamlet/

  • Je vidět, že červenec jde napříč firmou se všemi důsledky. Například těmi, že lidé vymýšlejí věci, na

  • Just read this http://blogs.technet.com/jamesone/archive/2008/07/12/you-know-you-have-been-doing-too

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment