Picking up the challenge which James set with his PowerShell Macbeth, I decided to do Hamlet. I have actually had a non-PowerShell computerized Hamlet implementation some time ago, but for James, here comes the PowerShell one:
PS C:\> Add-PSSnapin Shakespeare.Hamlet
Do you want to follow instructions from this untrusted publisher?
File Revenge.ps1xml is published by CN="The Ghost", L=Elsinore, C=DK and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never trust [D] Do not trust [R] Listen once [A] Always listen [?] Help (default is "D"): R
PS C:\> Get-Characters | Start-Revenge
Confirm
Are you sure you want to perform this action?
Continuing the revenge requires performing operation "Get killed" on Target "Polonius".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Continuing the revenge requires performing operation "Get killed" on Target "Gertrude".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A
And so on. 🙂
Tags: Art, Fun, PowerShell
2 Responses to “PowerShell Hamlet”