Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.
I was trying to test something recently and it didn’t work. One would think that I would remember to check versions, but I didn’t before posting on Twitter. I did get a response from @dbatools, and one of the questions was which version did I have.
I wasn’t sure, and wasn’t sure how to check, so I had to do some Googling around. This post notes what I found and how I got the version.
I have known that I can get the PowerShell version from $psversiontable. I can run that and see info about PowerShell..
This doesn’t get me a view of modules I’ve installed. I tried Get-Help, but it wasn’t what I wanted.
I then tried a search and stumbled upon Get-InstalledModule, which worked well, but it has a lot of info. When I run this, I get lots of data.
Fortunately, it’s alphabetical and I don’t have a lot of modules that are named with something after “d”, so I could easily find the data.
I know there’s an Update-Module and Install-Module, so I tried Get-Module. That actually works. I thought about this later, after I’d actually gone through the searching and posting results.
As with anything, there are a couple methods here, but certainly it’s good to be able to solve a simple problem like this one.
This was something I figured out in about 2 minutes. Writing this post took longer, but I bet I now remember this. It also might be something I get asked in an interview.
Try it yourself today. Start a blog and start documenting what you learn.