Fun and Games with PowerShell

My daughter has been learning Python which I know nothing about (I’m not a developer). I took a look at one of the programs that she’s been working on and said I don’t know Python, but I can create something better than that in PowerShell.

I hadn’t previously used a “do until” loop in PowerShell so I decided this was as good as an excuse as any to use one since the loop has to run at least once anyway and it gave me a chance to learn something new.

I would like to thank Jason Helmick for the tip on using the .NET Framework instead of COM for the speech as well as Rohn Edwards who originally wrote a version of the code shown below that used COM which I translated into using the .NET Framework as well:

µ

4 Comments

  1. Carl

    Nice and easy to follow for a beginner like me, thanks for posting Mike

    Reply
  2. DONALD WILKERSON

    By starting with half of the number you will always get it. So, start with fifty then half of that depending on direction and reduce from there with 1/2 each time

    Reply
  3. Johnny Think

    Great script, easy to read and understand. Your post inspired me to game a powershell game of my own. Its a russian roulette game. Heres the source code https://www.thinktreeit.com/programming/powershell/powershell-russian-roulette-tutorial/

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: