For last week’s Friday Fun, I posted a PowerShell script to create a traditional Bingo card. I hoped you would also learn a few PowerShell concepts along the way. This week I’ve taken this to the next level, and have a complete module that not only creates the card but also let’s you play the…
Category: PowerShell
PowerShell Regular Expressions by the Numbers
I’ve been working on something the last week that brought me back into sometimes frightening world of regular expressions. But as the saying goes, we only fear what we don’t understand. So a little knowledge can be a wonderful thing. In this particular situation I was looking for a regular expression to determine if a…
Friday Fun: Let’s Play Bingo!
Today Campers we’re playing Bingo. Or at least getting ready to. This week I have some PowerShell code that will create a BINGO card. For those of you outside of North America you might need to take a crash course on this game. But even if you don’t play, this article will demonstrate some useful…
Importing and Exporting Registry Items
A while ago I posted a function to export registry items to either a CSV or XML file. Recently I had a question on Twitter about importing, which I assumed meant from my exported file. The import is actually pretty easy as I’ll show you, although it did require a change to the original Export-Registry…
Friday Fun Out-Rainbow
For my readers who are just discovering my Friday posts, let me remind you that these are not necessarily practical, production worthy PowerShell scripts and functions. They are meant to be fun, yet educational. For example, in today’s Friday Fun I have a function that takes string input and writes colored output to the console….
We Pause a Moment
Most of the time when running a PowerShell script or series of commands you want to blast your way through. But there might be times where you want to pause script execution. Perhaps to display an informational message or to simply pace execution. In my work as a trainer and speaker I often use the…
Friday Fun – New Thriller
I read a lot of thrillers by authors like James Rollins, Jeff Long, Douglas Preston and Lincoln Childs. Certainly not high-brow literature, but generally well written and often a lot of fun. Of course with any fiction genre, there are certain thematic paradigms that must be followed, almost as if by recipe. Thus was born…
Convert History to Script
Whenever I teach or speak about PowerShell, a recurring mantra is that there is no difference between running a PowerShell script and executing commands interactively in the shell, except that it saves you typing. You can create a PowerShell script by simply copying and pasting commands from the shell into a .PS1 text file. This…
More WMI Dates – Win32Product InstallDate
I’ve written in the past about converting obtuse WMI datetime formats into more user friendly formats. The other day via Twitter I got a question about the InstallDate property that comes from the Win32_Product class. This property has a different format, than what I’ve written about previously. And while I think the format is easy…
Convert to Title Case
After a long holiday break, some travel and a few training classes its time to get back in the swing of things. Today I have a relatively simple function, that if nothing else demonstrates how to use object methods. The challenge is to take a string of text and convert it into title case; so…
Join Me in Orlando
I will be presenting 3 sessions at Techmentor Orlando 2011. The conference runs March 14-18, 2011 at the Disney Yacht Club. My sessions are all on Wednesday March 16. In addition to all the other fabulous material at the conference I will be presenting the following:
Out-CompressedFile
I’m not sure where this idea came from, but I thought it might be nice to redirect output to a compressed text file. I know disk space is cheap these days but perhaps you’re running PowerShell 2.0 on an older platform and you want to save output from a command that will generate a ton…
Friday Fun – The Kitchen Sink Prompt
On my last Friday Fun post on PowerShell prompts, I got a terrific comment from Bart Vandyck about his prompt which has just about everything you would want. I too have a “kitchen sink” prompt, that is to say, one with the proverbial “everything but the kitchen sink”. Or you might consider this an extreme…
Friday Fun – More Prompts
Not too long ago I offered up a tasting of PowerShell prompts 3 ways. My first offering were variations on displaying the current date and time. But a PowerShell prompt can do much more. For today’s Friday Fun I present a duo of of calculating prompts.
Test Registry Item Revisited
I got some nice feedback on my original Test-RegistryItem function. I had been mulling some enhancements anyway and now have a more robust version that looks at individual values, accepts pipelined input and more The new version now lets you test if a given registry item exists as well as if the value meets some…