Blog Post

Getting Your dbatools Version–#SQLNewBlogger

,

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..

2020-03-30 09_42_37-cmd - powershell

This doesn’t get me a view of modules I’ve installed. I tried Get-Help, but it wasn’t what I wanted.

2020-03-30 09_44_06-cmd - powershell

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.

2020-03-30 09_46_20-cmd - powershell

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.

2020-03-30 09_46_39-cmd - powershell

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.

SQLNewBlogger

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.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating