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

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{$ -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”


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 (7)

  1. Anonymous says:

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

  2. Anonymous says:

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

  3. Jeffery Hicks says:

    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?

    One of my favorites.




    Get-Sound -name "infantCry" -duration 2


    get-sound -name "breathing" -duration 20

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



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



    Get-Sound -name "InfantCry" -duration 3


  4. Andy says:

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

  5. Jonathan Noble says:

    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! 😉