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.
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.
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.
During the recent PowerShell+DevOps Global Summit I had two primary presentations, that is, traditional sessions with slides and demos. My other sessions were panels which means if you weren’t in the room you missed out on some great content and interaction.
Anyway….my main sessions were on creating class-based PowerShell tools and using Nano server in the datacenter. The former was a lightening fast 45 minute session where I tried to cram in as much as I could. The latter was a 90 minute walkthrough of building a variety of Nano server images to meet traditional datacenter roles. Again, there’s no substitute for attending.
But for those of you who couldn’t attend, all of my demo files are available on GitHub.
I realize not everyone has jumped on to GitHub yet. You don’t need a GitHub account to get these files. No need to fork or clone. All you have to do is click on the green “clone or download” button and download a zip file. Of course you are welcome to clone the repo if you’d like.
As far as recordings go, this was not a good year. My Nano server session was not recorded and I don’t know yet about the class-based tools session.
Thanks to everyone who attended my sessions. I hope you found them worth your time.
Today’s Friday Fun post, as most of these are, is a little silly and a little educational. Because I obviously am avoiding getting any real work accomplished, I worked on a little project that would add a border around a string of text. I often write formatted text to the screen to display information and thought it would be nice to be able to add sometime of border.