Throwing the Kitchen Sink at PowerShell

The other day I was watching a good intro video from Shane Young on getting started with PowerShell profiles. I use profile scripts extensively, and they can be extremely useful in configuring your PowerShell experience. One element you could add to your profile is a customized PowerShell prompt. Microsoft provides one by default. It creates a simple function called prompt. The best part is that you can define your own function called prompt, and PowerShell will run it every time you hit enter.

Continue reading

Who’s Driving this Shell?

Microsoft has been busy with the next iteration of PowerShell. As you should already know, this version will run cross-platform. The executable, or engine, is naturally different than what you are used to with Windows PowerShell. As I was trying out the latest PowerShell beta, I needed to identify the path to the current PowerShell engine. I then thought it might be helpful to get even more details so I put together a quick PowerShell function called Get-PowerShellEngine.

Continue reading

Friday Fun: PowerShell Anagrams

Maybe it’s my liberal arts background but I love words and word games. I have a constant pile of crosswords and enjoy tormenting my kids (and wife) with puns.  I am also fascinated with word hacks like palindromes and anagrams. An anagram is where you take a word like ‘pot’ and rearrange the letters to spell another word like ‘opt’ or ‘top’.  Short words are easy to do in your head.  So I thought why not get PowerShell to do some of the letter crunching for me.

Continue reading

Your First Day with PowerShell

I’m happy to let everyone know that my latest Pluralsight course is now available. “Your First Day with PowerShell” is a short course targeted at the absolute PowerShell beginner.

Your First Day with PowerShell Objectives

I wanted to be there as it were as you started your very first day learning and using PowerShell. My goal was to be with you virtually, and guide you through how you should spend your first hours with PowerShell. If you’ve decided to set out on the journey, I wanted to make sure you head off in the right direction and not on your own. You can check out a short overview clip here.

Clearly, you aren’t going to learn PowerShell in 90 minutes and you should watch this course in conjunction with some of the other PowerShell fundamentals courses. For those of you who have already watched the course, thank you. I’ve received plenty of nice comments.

Now I’d better get back to work on the next one!

Friday Fun: Listing WMI Namespaces

Welcome once again to the end of the week.  Hopefully you spent some time in PowerShell. If not, perhaps this tidbit will be intriguing enough to give it a try. I always try to put the “fun” in function and today I have one that will enumerate all the WMI namespaces, but using Get-CimInstance, or the “modern” way to work with WMI. You probably know about the root\Cimv2 namespace but there are many others and if you explore you might find some other namespaces and classes that are useful.

Continue reading