PowerShell for fun (and profit?)

Let’s have a liltle fun with PowerShell. Along with, I suppose, a couple of useful things and links.

PowerShell is useful for a great many things, but I like it best (on a day-to-day basis) for the little things that it simplifies. For example:

  1. Windows-R to get a Run dialogue.
  2. Type powershell.exe restart-computer
  3. And your computer restarts!

I like this a good deal better than all the hunting around with a mouse to find the durn power icon, wherever they’ve moved it THIS week.

I also dig being in a PowerShell window and being able to open the output file I just generated, with the command notepad.exe c:\temp\filename.txt.  I am nothing if not lazy efficient.

What other fripperies can we use in PowerShell?

So I got to thinking…PowerShell must know where Notepad.exe is – namely, in c:\windows\system32. So it must (of course)  be able to run other system EXEs really easily.

I began scrolling through the extensive list of apps in the sys32 folder, and stumbled across:

*snortlaugh*

Sure enough, you can “launch” the command window from within PowerShell. It looks a little like this:

 

Yes, this is silly, and mostly useless. But it’s fun. Or more to the point, funny.

Okay but seriously, why are we talking about this?

Mostly because it amused me. But also to remind you that there’s good work to be simplified with PowerShell, and sometimes some good fun to be had, too.

You can, for example:

  • Launch the control panel with control.exe
  • Or MS Paint, mspaint.exe (I’m not the only one that still uses this!)
  • Or Magnify, magnify.exe

If you’d like to learn PowerShell, check out the Beginning PowerShell session on our Events page, and the PowerShell tutorials on MidnightDBA.com.

 

2 thoughts on “PowerShell for fun (and profit?)”

  1. I’m sorry, but calling commands from the command line is not, in my opinion, simplifying things with PowerShell. All you’re doing is calling the command line commands that have been around for much longer than PowerShell. You’re just doing from a PowerShell window instead of a standard command window.

    There’s only 1 thing in this post that is PowerShell and that’s the restart-computer command and even that is just as easy without PowerShell.

    1. Windows-R to get a Run dialogue.
    2. Type shutdown /r
    3. And your computer restarts!

  2. Hey Robert,

    Well, this is a pretty light piece that’s meant to get newbies involved in PowerShell at all.
    And, it’s a bonus to be able to interact with the same commands we’ve always known (if we’ve known them) in the same environment where I’m already doing other, actual PowerShelly things.
    And, there are of course multiple ways to do any given thing in Windows…I learned restart-computer before learning about shutdown /r (hey, you can’t catch everything).

Leave a Reply

Your email address will not be published. Required fields are marked *