Scripting Games: Advanced or Beginner? Or maybe both? :)

2010_scriptgames_badge1

OK, I’m really having fun while taking part in Scripting Games. Writing script with a purpose, even if this is something I would personally never use, helps a lot when you are trying to know new technology. I love writing cmdlet scripts, because it so simple to get parameters, write help, provide examples, and so long, and so forth, that it’s really hard to resist. There is one thing though I can’t understand.

I’ve decided to do “Advanced” scenarios, and I feel comfortable with it. However it’s not hard to notice that there are people out there who do both. I wonder what’s the point? Most of scenarios for beginner are those for advanced with some pieces cut off. In other words: if you created script for adv it’s only a matter of deleting few lines to create beg as well. Of course it does not harm me in any way, I’m glad that I got so many points already, but… why?

In my opinion it should be different: either scenarios should be written in a way that prevent such a easy-solution (write once, submit twice) or it should be clearly stated that one can only submit to each event with selected level.

So: I won’t do this cut & paste, I’m loosing few points here and there maybe, but I prefer to get rewarded for thinking rather than copy & paste. That’s too simple and has nothing to do with scripting games. 😉

Meanwhile: I’ve found so many cool things while writing the scripts for that challenges, consider this simple function:

function Get-CLICredential {
    $TempUser = Read-Host -Prompt "Please enter alternate username"
    $TempPass = Read-Host -AsSecureString -Prompt "Please enter password"
    $Global:TempCredentials = New-Object -TypeName Management.Automation.PSCredential -ArgumentList $TempUser, $TempPass
}

Don’t like GUI? Mouse is last thing you want to touch when playing in PowerShell? Need credentials here and there? Here it is. 🙂

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s