ps1.soapyfrog.com

doing inappropriate things with powershell

Pages

  • About
  • Downloads
  • Archives

Search

Popular Posts

  • Grrr 1.1 and Big Invaders
  • Space Invaders
  • Convert images to text (ASCII art)
  • Cmdlet clashes
  • Console screen grabs in html

Recent Posts

  • Grrr source code, including Invaders
  • Google going down the pan
  • Cmdlet clashes
  • Grrr 1.1 and Big Invaders
  • Grrr, Cmdlets and PSInvaders revival

Categories

  • Announce (7)
  • Cmdlets (2)
  • Cool (16)
  • Grrr (6)
  • Hint (2)
  • Invaders (5)
  • Odd (2)
  • PowerShell (27)
  • Quiz (3)
  • Rant (7)
  • Uncategorized (1)
  • Utility (5)

Months

  • August 2007 (1)
  • April 2007 (1)
  • March 2007 (1)
  • February 2007 (3)
  • January 2007 (25)
  • December 2006 (1)

Bookmarks

  • Blogroll
    • $script Fanatics
    • blog.soapyfrog.com
    • Brian Long
    • Lee Holmes
    • Nik Crabtree
    • PowerShell-Scripting (French)
    • Richy Rich
    • The PowerShell Guy
    • Windows PowerShell
  • Links
    • Carbon-neutral web hosting!

Meta

  • Log in
  • Posts RSS
  • Comments RSS
  • Valid XHTML
  • Valid CSS
« Grrr, Cmdlets and PSInvaders revival
Cmdlet clashes »
 

Grrr 1.1 and Big Invaders

26 Feb 2007 04:29 pm// Announce, Cmdlets, Cool, Grrr, Invaders, PowerShell    

So I’ve been spending a bit of time getting to grips with Cmdlets and resurrecting interest in PSInvaders using Grrr and now have something to post.

Grrr 1.1 is now Cmdlet based and comes as a Snap-In. The most obvious benefit from this is performance, as I can now present a playable version of PowerShell Big Invaders.

BigInvaders 1.1 in play

BigInvaders is one of the demo PowerShell scripts that makes use of the Grrr.

Download this prerelease version 1.1 of the Grrr snap-in.

Update: this should now install on Vista – thanks to Chris Warwick for pointing out some issues

There’s no installer (yet) so to get going, follow this instructions:

Unzip the archive where you want to use it and CD to the top level director where the README file is.

Type: ./installgrrr.ps1 -r

The -r switch forces it to re-register the snap-in if a (possibly) older version exists. It then adds the snap-in to the current shell.

From here you can CD into the demos directory and run any of the scripts. Each one shows a feature of Grrr, but perhaps the most interesting is in the biginvaders directory.

To run BigInvaders, you need to have a very large console. To achieve this you probably need to set the font size of your console window to 6×8.

If you want sound, you need to install DirectX DirectSound. More on why later.

It should work without, silently, but this hasn’t had much testing as all my XP boxes have it installed :-) If there are exceptions, start it with the -nosound switch.

Assuming all is well, type ./biginvaders.ps1 and you should see this title screen:

BigInvaders 1.1 intro screen

Hit ESC to quit or Space to play. In play, Space fires a missile and arrow keys move left and right. Hit F to toggle FPS display in the top-righthand corner.

The target FPS is 33. I achieve this easily on my MacPro, and my wife’s Dell (a core 1 duo, 1.66ghz) also just manages.

There are still a few snags to iron out here and I want to add proper PowerShell help and an installer, but it is functional.

I’ve learned a lot about C#, PowerShell SDK and .NET these last weeks and will write about my findings over the next days. It’s not all been rosy.

I’ll also be writing about the features of Grrr, and where I want to go with it.

That’s it for now.

Comments (11)

11 comments to “Grrr 1.1 and Big Invaders”

  1. On 24 Feb 2007 at 3:15 pm, Chris Warwick said:   

    Cool!! Couple of issue tho’

    - The installer has a hardcoded path pointing to your C:\ drive. Fixed easily enough….

    - …but, the InstallUtil command fails on Vista with the following:

    System.InvalidOperationException: Unable to create an instance of the Soapyfrog.Grrr.Meta.GrrrSnapin installer type.
    The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by th
    e target of an invocation..
    The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does not allow partially trusted callers..

    So, I can’t run it :-(

  2. On 24 Feb 2007 at 3:56 pm, adrian said:   

    Oh yea, sorry on h/c path :)

    Vista: I don’t have it, so can’t say why it behaves differently… anyone?

  3. On 24 Feb 2007 at 5:08 pm, adrian said:   

    Had a thought… does the download need to be blessed, or otherwise approved, as Vista probably thinks it came from an untrusted source… XP had something along those lines for scripts.. an option on the file properties dialog box.

  4. On 24 Feb 2007 at 11:12 pm, Chris Warwick said:   

    Good thinking, but just modified the dll and tried again – exactly the same result. A quick Google found this that looks like it might fix the problem?

    http://www.kodyaz.com/blogs/software_development_blog/default.aspx

    To solve this security exception I mark my assembly by using the AllowPartiallyTrustedCallersAttribute (APTCA)

    I used the AllowPartiallyTrustedCallersAttribute (APTCA) in the Assemblyinfo.vb file since my project was developed in VB.NET. You can add the attribute AllowPartiallyTrustedCallersAttribute in Assemblyinfo.cs for C# applications.

    Use the below code line in vb.net

    [assembly: AllowPartiallyTrustedCallers]

    Prior adding the AllowPartiallyTrustedCallers attribute you should check that you have imported the System.Security namespace

    Imports System.Security

    or

    using System.Security

    Cheers,
    Chris

  5. On 06 Mar 2007 at 11:20 am, jsc: space invaders « c# to javascript said:   

    [...] And if you are into monad/powershell give a shot at Adrian’s implementation. [...]

  6. On 06 Mar 2007 at 11:27 am, zproxy said:   

    Just to let you know I just implemented the same game in javascript.

    :)

    http://zproxy.wordpress.com/2007/03/03/jsc-space-invaders/

  7. On 06 Mar 2007 at 12:08 pm, adrian said:   

    Very nice. Always good to see Space Invaders alive and well in the world :-)

  8. On 21 Mar 2007 at 4:48 pm, Marco Shaw said:   

    Will you make the source available? Will you share more on your cmdlet development experience?

  9. On 27 Mar 2007 at 7:28 am, adrian said:   

    >Will you make the source available?

    Probably. I wanted to get the cmdlet help docs sorted out before releasing it.

    > Will you share more on your cmdlet development experience?

    Yes. I’ve been on holiday recently so PS1 has been rather low on my list of priorities :-)

  10. On 13 Aug 2007 at 6:12 pm, marco.shaw said:   

    Still planning on releasing the cmdlet source? Just taking a break for the Summer or is your “interest” in PowerShell completely gone?

  11. On 26 Aug 2007 at 3:26 pm, adrian said:   

    I’d sort of forgotten about it. Sorry. I don’t need/use PS1 in my day to day work and have other priorities outside of work.

    I’ll package it up though and post shortly.

Copyright © 2006-2010 Adrian Milliner

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.