Category Archives: Extra

More blogs, articles, reviews, and anything else that is PowerShell-related, but doesn’t necessarily fit into the other categories.

A Return to PowerShell

After 20+ years, and 5+ positions in education (K-12 and higher ed), I’ve taken a new position. It’s still Information Technology at the end of the day, but now I’ll be working in the healthcare industry. There’s plenty of reasons to be excited. One is that I’ll be better positioned to use my PowerShell and automation skills again. Two, I’m moving from an employer that’s AWS-focused to one that’s Azure focused. What an amazing opportunity! I ventured into Security Engineering, but now it’s back to Systems Engineering for me. It was a great experience and opportunity, but like any new position—well, usually anyway—I’m excited about what’s next.

I was in my interview and the time came when I could ask questions. I asked, in relation to work, “If you had an unlimited budget and cost was of no concern, what would you do?” My new lead said he’d take everything to Azure. Okay, sign me up! It was in later 2020 when I picked up Azure and Microsoft 365 certificates; hopefully, they may be put to use soon.

I’m hopeful that this position provides me the opportunity to create new content and to share new things I learn about Azure PowerShell and just PowerShell, as well. I miss writing, but with more day-to-day opportunities to work with PowerShell, I know what will happen. I’ve done this PowerShell writing thing for greater than eight year. So with that, hopefully, I’ll be back with something new soon.

I wrote the above portion of this post weeks ago, and now I’ve completed two full weeks at the new job, and guess what I did yesterday afternoon? I wrote a PowerShell script for a colleague. I took a starter script and fixed it so it could be run from anywhere and access a flat file in the same directory—thanks $PSScriptRoot. I also added a bunch of features to it, which while they may not be necessary, was exciting for me. I worked with so much I missed. I wrote more PowerShell yesterday than I did in the last year and a half in my security position. My thought is this: In security, you have to buy tools; you have to have a reputable company behind what you use. In systems, that isn’t required; you can automate without the same concerns. It’s good to be back.

I Want to Write

I’ve done this for eight years to the month. I’ve taken my passion for PowerShell and written about it. I desired to play a role between PowerShell and its concepts and you, the reader. I’ve written for myself in some ways, to better remember concepts and to create a collection of code I might come back to again. But I’ve done more than just that.

I’ve fallen in love with writing. Again maybe. While this isn’t my normal every week post, I’m going to take advantage of this little platform that I’ve created for myself, and share, not about PowerShell, but about my desire to write. Maybe you know someone, that knows someone, that knows someone. How I feel about PowerShell has been apparent; the writing is what’s changed me though. I said again, a moment ago for a reason.

See, I hated grammar and parts of speech in grade school. I’m all about it now, but you know what I did love then, though? My journalism classes. How I didn’t combine the two classes in my mind is kind of lost on me; I’ll blame it on my grade school age. Then again, even though I didn’t like it, I do remember learning some things. So, I took multiple, year-long Journalism classes. I scheduled interviews and asked people questions, and then wrote things down, and then wrote things up, and shared with our readers—my fellow school mates. Your quick investment in reading was hours of mine preparing it for you.

Here’s a weird one. Some of my favorite times at work is when I’m writing email. Huh? Right. I’ll combine four, five, or six sentences, in an attempt to clearly and accurately convey a topic, a concern, a question, or questions. A something. Whatever it is, it’s that mini accomplishment that I enjoy over some of the others during my day. It may be how you know you love to write; it’s turned into that for me. Sometimes I’ll read what I wrote again after hours, and determine how it could’ve been better written, or how I could have written it to be less confusing. It happens; writing is an iterative process, and no one wants to spend too much time on a simple email, or two. Sure, I guess.

Why am I writing about this? It’s because someday I want an employer to pay me to write, to do what I love. I want a specific thing to write about—a single, specific technology, as a profession. I want to be a technical writer—a content developer. I want to play the middleman between technology and the people that need, or want it, or have to have it even if they don’t want it. The irritated needful: the best and worse audience. I want to supply the reader so well that they’ll know I value their time more than my own.

The easier something is to understand, the more grateful those that are forced to learn about it may become. I want to break down the complex; I want to begin with the simplest example from which we could start. You know, what I’ve done right here for years now. Making the complex, complex, is easy. It comes that way. Making the complex, easy, is what each of us hopes for when there’s a requirement to learn something new. At least to begin.

If you got this far, then let me know if you have any ideas for me. I have years of technical experience, but now, I just want to make someone’s customers pleased they read what I wrote. Without customers, forced—because they have to, or earned—because they want to, there’s nothing. Whether they must use you, or not, give them what they need without them having to ask for it first.

Post Number 416

It was June 2014 when I started taking my love and passion for PowerShell and putting it on display for people across the world who might benefit from it. You know, right here at tommymaynard.com. My hope is that others may have found my posts helpful to their learning about PowerShell and in building their own projects. The latest that I wanted to reach this 416 post milestone was by the end of June 2022. At that point, in eight years’ time, I would have averaged one written and published post per week. That means that as I continue to write up until the end of June 2022, I will ever so slightly move past the one post published per week average. I have to get to 458 posts — another 42 — to get to 1.1 posts per week for eight years. That is probably not going to happen.

I did all of this with zero advertisements, no popups, or anything else that might get in the way of enjoying and learning about PowerShell. I was a diehard VBScript lover, but I am beyond grateful that I gave it up when I did and moved to PowerShell. I wish I had done it sooner. If I had, there might have been another few years of PowerShell experience under my belt today. There is so much I still want to learn and experience in relation to PowerShell, so those years would have been helpful for me. I cannot wait to see where I am in two or three more years!

Anyway, that is this whole post. I still love PowerShell, I still love to write, and so I cannot imagine why I would ever stop either one. You can expect more from me here, doing my thing, when I create something or find something I think would benefit the PowerShell community.

PowerShell Painting

I have no idea what you thought you might be getting into when you followed a link to this post. Maybe some painting in the ConsoleHost, because if that is not a thing, it should be. Anyway, that is not what this post is about.

My daughter has come up a few times during my years of writing here. Poor girl. In the first below picture, she is doing an art project when she was probably five. She does not know much about PowerShell, other than it is something her father is passionate about. Hearing me say it a time or two or two-thousand has apparently influenced her. If someone asked her what her dad does for work, she would probably say “PowerShell,” before “computers.”

This picture is from her playing the 1 to 100 Game in 2016. There was also a recent post where she was mentioned called Testing Multiplication Facts. That was a PowerShell tool made for her.

So back to painting. Today we did a painting project together. I wanted to see how she would do painting the PowerShell Girl again after painting her two years ago.

To begin, the first thing we did was trace a printed image on two canvases. Luckily she found the template with the art supplies. I did not want to make that again or attempt to draw it freehand. It may be hard to tell, but even with the light coming in it was not easy to trace.

This next picture is from the table we were going to use, but we had to relocate. Still, good photo.

Here is the second table where we set up shop. Everything was ready to go.

After a solid 45 minutes to maybe an hour, we were done. Here are her two paintings. The one from 2020 and the one from today! I think we would have both wanted the hair to be less black and more purple, but it was the best we were able to do with the paints this time. She was thrilled with her newest painting. Maybe we will do it again in 2024.

There are plenty of passionate dads out there. My passion just happens to be technology, computers, automation, and most of all, PowerShell — so these types of things happen. It was quality time spent making art for the home office. And now that the office is back together — there was a flooring project that just ended — it is time to get the older, and now newer, paintings on the wall. Sorry, that there is not much to learn here this time. I figured why have just a picture on Twitter when can have a post here, too. Back with more PowerShell soon — the way you would expect to find it.

Learning PowerShell

Every few weeks or so, over the last 10 years or so, there is a new post somewhere, where somebody is asking about the best way to learn PowerShell. It has probably been a thing beginning in 2006. While I have not been evaluating this since then, I have noticed it long enough to feel confident in this statement. So confident that I have heard it for a long time, that I will remind everyone that I even wrote about it in 2016. In the time since the initial PowerShell launch, books have been written, videos have been recorded, new domains established, and web hosting purchased too. All of these have been done in the name of teaching other people PowerShell.

For all the posts I see where someone is looking for the best way to learn, I cannot recall hearing anyone mention the official PowerShell documentation. Okay, I saw a link somewhere recently, but it is not often mentioned. I have been spending some time there recently and it is undeniably thorough. It is well-written, explained clearly, and written for the newest of PowerShell users. The examples start with only the basic structures required. Not everyone out that does that, and it can be frustrating at times. I have been there, where I only want the simplest of examples from which to work. But some of the content out there is wildly complex and is obviously intended for an advanced audience. While I have always tried to write intermediate content with basic examples, not everyone has and that is fine.

Here is a link to the PowerShell About topics. Maybe spend a moment there right now. I dare you to challenge yourself to learn one new thing before you continue reading this post. On the linked page, scroll down until you find a topic that is not that familiar to you and read it — maybe even just a paragraph or two is all you will need. Stop when you learn something new. I will do the same and share what I learned…

For me, I scrolled down to about_Debuggers, where I learned that the Get-PSCallStack command is considered one of the Debugger Cmdlets. I know the command and have even written about it myself, but I never considered that it would be a debugging tool, although it makes perfect sense that it would. There is even documentation on all the, Microsoft-written commands. Here is where you can read more about Get-PSCallStack.

Here is my post on that command — I do not even mention debugging, so yes, I learned something new. It took less than five minutes. Hopefully, you really played along and learned something too. You are welcome to Tweet me what you learned and that way we may all learn something from it. Be careful though, learning and teaching people about PowerShell can be addicting.

Another challenge is that if you think you know a PowerShell topic, take a minute and read top to bottom on one of the About pages. You are probably going to learn something new. I was reading about the -replace operator recently and learned a few things I had never considered or known, simply because I have never needed to use it that way. Good to have read before, as someday I may be out there searching for a solution.

If you want to learn PowerShell, do not forget about the product’s own documentation; it has been written for you, by the people intimately involved in PowerShell. Like, it is their job. They create the resources that you can use to completely learn PowerShell — and it is all free. Maybe read two a day. Your job may provide some room for personal development, so read one to start the day and one to end it.

Changing direction a bit, the next thing I want to discuss is a script I wrote years ago. It is available on the PowerShell Gallery and it is called the Start-1to100Game3.0. If you are wondering, yes, it still pains me that I included the version of the script in the script’s name. Let that be a lesson.

This project was awesome. PowerShell chooses a number and then you select higher or lower until you guess the number. Simple concept, but well written. It kept totals, allowed continuous gameplay. I wrote about it many years ago, so read about it here if you want to know more.

You can download the poorly-named script using the below command.

Install-Script -Name Start-1to100Game3.0

By default, the script is going to be downloaded to the Scripts directory. On my computer, that is C:\Users\tommymaynard\Documents\PowerShell\Scripts. As you may know, you will have to dot source the script (as it is written as a function). This will allow you to run the function in the current scope. There is more information about this in about_Scripts. Here is the information you might be after on that page:

The dot sourcing feature lets you run a script in the current scope instead of in the script scope. When you run a script that is dot sourced, the commands in the script run as though you had typed them at the command prompt. The functions, variables, aliases, and drives that the script creates are created in the scope in which you are working. After the script runs, you can use the created items and access their values in your session.”

I could not have said it any better myself. So, keep in mind the About pages for learning PowerShell and enjoy a quick game of the 1 to 100 game — why not?

But, before we wrap up, what do these two things have in common!? Why have I placed these two topics — learning PowerShell using the About topics and my 1 to 100 script in the same post? Hopefully, I will be telling you soon. I am doing that thing where I am writing posts here before I write the PowerShell to back them up. So…, as long as I complete that project, some of this may actually make sense. And if it does not, at least we all got a reminder about the PowerShell About Topics and learned about an interactive game you, or your little one(s) — if you have those — can play. At this point, perhaps I will be back with more!

It is All About the PowerShell Users

There was a recent series of Twitter posts from Jeffery Snover, the inventor of PowerShell himself. It started with the 15th birthday of PowerShell, which happened recently. I think I have captured it all here; have a read. You may have missed it and … I do not think that anyone should.

Jeffery said, “The thing I am most proud of is our unwavering and complete focus on our users – it is about them not us.” It goes on, “Notice that I used the word “user” and not “customer”. Why? Because PowerShell is free. It is a benefit of being a Microsoft customer. That distinction is critical.”

That was what allowed us to backport to previous OSes instead of using it to force people to the latest version of Windows. That was what allowed us to ship V2, V3…V7 when some thought we should stop after V1. That was what allowed us to open source our code.

There was more, That was what allowed us to partner with VMWare, Amazon, Google and many other customers that our users also used. That was what allowed us to port to Linux. And so many other things. I honestly cannot think of a more USER-centered project in the entirety of MSFT history. PowerShell is about our USERS not about us THAT is what I am most proud of.

I get that PowerShell has long been an investment in users. Back in 2013, Jeffery wrote this Tweet: “The team made a promise so important, we called it our sacred vow: Learn PowerShell and we’ll do everything we can to make it the best investment you’ve ever made. It’s 13 years later and I can confidently say that we have kept faith with that vow.

This was obviously a couple of years ago.

I bring all this up because, for me, it has been about the users too. I am into PowerShell so much, that I do what I can to bring others along with me. Microsoft has given us a tool to automate, and in doing so, given us a way to become highly efficient, and to ensure accuracy. Those are the words to live by when it comes to PowerShell: efficiency and accuracy.

So, if you didn’t get to read these comments from Jeffery Snover before, I am glad you have now! Hopefully, they will stick in your brain, as they do mine.

Bye-Yee ISE – Hey Yo VS Code

It is official — as official as it is going to get anyway — but I am in the final six-month stretch of my eight-year consecutive run of writing about PowerShell. Not that I will be done after eight years, but I have been at this awhile. What is also official is that I have written the dumbest post title yet. I am going to go with it though.

Today I had an interesting “conversation” on a post in the PowerShell Subreddit. The full link, if you are interested, is included at the bottom of this post. But really, the important parts are all included here.

The post was about someone using Write-Host that should have been using Write-Output. That was not where I took the conversation, however. Instead, it became a discussion about moving away from the ISE to Visual Studio Code. I think that this is an important move, and so I thought I would include it all here because I think I made some good points, and maybe because I am after that 416 post count by June 2022. More the first, though.


Me: “Beyond that, OP, it is time to move away from the ISE, and probably Widows PowerShell too. 2¢


Not me, or the OP: “Nah, ISE4LYFE

Me: “[SMH] Think of your résumé: ISE vs. VS Code. Speaking of your résumé, did you do create that in Notepad and print it on a dot matrix? 😉 I loved the ISE once too, but I think it’s time…


Not me, or the OP: “I mean, I’m not old enough to have used dot matrix (well, kinda, 30)

My main issue with VSCode vs ISE is that it’s a UI mess from as soon as you install/open. Vs ISE, it’s just notepad ontop of powershell.

ISE is just easier for me for the quick and simple stuff, where i just bust out some script for a minute or two.

Granted, running the code-server is really nice


Me: “Oh, I get it. VS Code takes some time. It took me some to finally give up the ISE in full. And, I’m the same guy that paid attention to the PowerShell launch in 2006. One person, around that time (that I believe was associated with Microsoft), said that if you’re using VBScript, then continue to use it. That it is still going to be there, as in, in the operating system. That’s all it took for me to not pay attention to PowerShell! I bet the ISE is still going to be there too.

Cut to six years later, in 2012, and I finally let go of VBScript, which I loved, and forced myself to use PowerShell, which I now love. You’d have to pay me a large amount of money to even look at VBScript now. While I can’t say the same thing about the ISE, I’d miss VS Code an awful lot if the ISE is all I had. While it took some time and frustration and wanting to go back, I pushed on!

Speaking of, “if the ISE is all I had,” I recently wrote an AWS CloudFormation template to build out a vanilla Windows Server, server. It was beyond frustrating to build a new instance and only have the ISE. As a part of the CloudFormation, I installed PowerShell 7, installed VS Code, and installed the PowerShell VS Code extension. Again, I once loved the ISE.

Here is the PowerShell Subreddit post.

PowerShell User Group Austria – Crescendo

This morning — well, this morning my time — I was a part of a speaking event with the PowerShell User Group Austria, where I discussed the Microsoft Crescendo PowerShell module (https://github.com/PowerShell/Crescendo and https://www.powershellgallery.com/packages/Microsoft.PowerShell.Crescendo). It was clear to me that a couple of related posts of mine got the attention of Roman, and put me in a place where I could share what I knew about the project. It was fun!

The project just entered preview-2 on May 6, 2021 — a mere five days ago. While I didn’t focus on the additions from that preview, I essentially walked through my Part I and Part II, which were written with preview-1 in mind. I did, however, mention the additions that preview-2 brought us.

As I stated I would during that user group meeting, I’ve offered up my demo file. It includes several helpful links, as well as everything I used to create those things I did. The paths won’t line up with your system, so keep that in mind if you work through the examples.

PowerShell_User_Group_Austria_DemoFile (2323 downloads ) PowerShell_User_Group_Austria_JSONFile (2669 downloads )

 

The 350th Post

This folks, is my 350th post. Timeout, it turns out this is actually my 351st post. I was so busy writing about PowerShell vs. Windows PowerShell and the LAPS module that I blew right past this milestone — a milestone I had hoped to write about when it happened. I’ve spent several years now enjoying those moments when I can write about PowerShell, so I suppose it’s no surprise that I’m here. Let’s do some math!

June 2014 to December 2014 is seven months. January 2015 to December 2020 is 84 months. January 2021 to February 2021 is two months. That’s a total of (7 + 84 + 2 =) 93 months. Three hundred and fifty-one posts divided by those 93 months is a 3.76 posts per month average. Not bad!

That’s a huge amount of dedication to a single technology. But PowerShell has prepared me for many different things. It’s improved my logical and conditional thinking, it’s improved my functional programming, it’s decreased my development time, and provided both the community and myself a place to store my thoughts, ideas, and solutions.

I’m not ready to call it quits by any means. That does remind me, I did notice an announcement yesterday. Microsoft has announced a new community blog. I can’t imagine not contributing. After writing at PowerShell.org for a year you can bet that I’ll be thinking of the best way to contribute on this new Microsoft PowerShell blog, too. (https://devblogs.microsoft.com/powershell-community/announcing-the-powershell-community-blog). Until the next milestone!

It’s Been Forever, Right?

You may not have even noticed — some did; some didn’t, but it’s been real quiet around here. Here, as in my blog. Due to the pandemic, I’ve had much more time at home to write, and somehow I just didn’t. I rode the exercise bike more, I sat in the backyard and watched the desert animals more, I drank more iced tea — probably, I washed my hands more, and I even slept more. That approximate hour that’s necessary to drive, park, and walk into the office has been used for extra sleeping, minus the time lost in the morning for the exercise bike. It hasn’t been used for, well writing. There’s been plenty of learning, authoring PowerShell, and picking up certifications, but it’s about time to start authoring PowerShell content again.

During my dry (writing) period, I felt like I should learn more about Azure and Microsoft 365, so I studied, tested, and passed those two fundamentals certifications. I also got that Microsoft Python certification — huh? Did you even know that was a thing!? I think I found out about the certification around mid-2019 and I instantly wanted it based on the strangeness of the whole thing. I thought more about it, however, and came up with some better reasoning. One, while I’ve read one Python book, I haven’t had an opportunity to implement Python in production and so perhaps the certification would provide some proof of skill in that area. Two, Microsoft has a Python certification. This isn’t the same as the initial reason. Microsoft is serious about Python, so much so that they want me to know it. This means that it may have value alongside any Microsoft and/or Azure work I may complete in the future. We all know how important and frequently used Python is across our industry. Even as PowerShell aficionados, it’s something we have all probably noticed — so why not know something about it, too? Beyond that, PowerShell skills transfer to Python quite well.

I won’t begin discussing it in this post so much, but it’s Splunk that’s really brought me back. Learning something about it and writing code that sends data to it, is why I’m even authoring this post — I just know it. I’ve spent the last few weeks learning about how to get output from my PowerShell functions into Splunk as telemetry data. That code is sitting idle in VS Code now, and it needs a home. Well, a home outside its code repository. So while we won’t start discussing it more now, I will be discussing it soon. As I’ve done before, I intend to use my blog to help hang on to code I may want in time. Additionally, and like I’ve always meant to do — going all the way back to 2014 — it may help someone else. There was a good deal of information I didn’t understand a few weeks ago. The PowerShell Splunk code I did find online wasn’t instantly beneficial to me. I didn’t have a Splunk background. Hopefully, someone reading my upcoming writings (that has a PowerShell background), will find it beneficial due to only having a small amount of, or no, experience with Splunk. I’ll do my best to help explain the Splunk part the way I had hoped I would’ve found it online.

Back soon (this time).