PowerShell Learning – All The Stuff!!! — Part 4 of 45 min read

In this final edition of my “PowerShell Learning series” I will cover how PowerShell has improved my DBA skills as well as how it has put me on some new tracks of learning.

Previous Posts:

Part 1 of 4 – PowerShell Learning for the SQL DBA

Part 2 of 4 – PowerShell Learning – SQL Migration for the SQL DBA

Part 3 of 4 – PowerShell Learning – SSRS Data Source Mystery

Stuff I have learned:

When I started this journey, I had no idea the power that this new tool would have on my day-to-day job. I have always heard of PowerShell, seen people talk/blog about it but I never really took the time to see how it could help my DBA work.  When I found dbatools I became very intrigued. Not only was the tool easy to use for a non-PowerShell pro, it had so many functions that I could use daily to help speed up my job.

The community around dbatools is amazing.  There is so much help to get you going in the correct direction if you get stuck.  There are new helpful functions being developed and released at a very rapid pace. Chrissy LeMaire (t) is the creator of the tool and has been so welcoming, supportive and inclusive.  Recently, she had gotten so excited about learning Pester for testing PowerShell functions that late one night she took the time to show me what she learned and walked me through creating my first Pester test.  It is that enthusiasm for this stuff that is so contagious.  That is why I have been on this journey to learn PowerShell.

While learning PowerShell, that has morphed in to learning other technologies as well.  While these extra tools are not required to make great PowerShell, they do and they really help when working with a team of developers and public code.

Tools and Other Stuff:

Visual Studio Code – This is a new tool from Microsoft that is a lightweight code editor that integrates some of the other tools that you might use to produce code.  It is not language specific so you can code in the language of your choice and add extensions from a marketplace to help make you more productive.  I have spent the last week using it and while it is a transition for me, since I am not a developer and do not spend my day in an IDE.  I am trying to think more like a developer and find the most efficient way to perform the task I am trying to accomplish and Code is a great foundation to that.

Git / GitHub – This is the latest and greatest in code repository and versioning.  Git was created by Linus Torvalds who also created the Linux OS.  He wanted a way to create and collaborate on files in a distributed environment.  GitHub was built on top of Git to allow in a lot more team collaboration and conversations during code development.

This has been my weakness and biggest challenge in this journey.  Since I was not a developer by nature branches, merges, commits, pull requests where all foreign to me.  And there were multiple times I did it all wrong. But this again is where community comes in handy to help you out of a bind.

Pester – This was the most recent tool I was introduced to and have stared down the learning path.  This tool allows for Test Driven Development testing integration for your project.  After reading about TDD it seemed totally backwards to the thinking I would have thought for development and backwards to how I have always approached a project.  Get this you build a test first and it will fail.  Then you go and code away until your test stops failing.  I have over simplified it, but that is the highlights of what I understand. Who would have thought something must fail at first for you to succeed in the end.

Slack – This is an online community with specific groups focused on specific topics. To me it is an online chat room where I can ask questions or get comments on code I am working on.  And if someone in that channel is online and has the time to help, they usually jump right in. Join the SQL Community on Slack and hit up the #dbatools channel.

dbatools – The reason behind my recent madness.  I am obsessed about this project and want to help and contribute in any way I can. And as previously mentioned the group of individuals driving this project really promote sharing and the more hands the easier the work.  I have offered my hands for anything I can do to assist and have contributed in small ways.  As my PowerShell skills grow I hope to contribute more on the coding, but I am happy now to help with the mundane tasks that the experts don’t need to waste their time with.  I am happy to do those things.

Conclusion:

While this is not a technical conclusion to the series, I feel it is very beneficial for someone that might be looking to learn something new and have that place where you are welcome to come in as a rookie and leave not a rookie.  That old saying do something you are passionate about has rung true with me the last six months that I have made a conscious decision to focus on learning a new tool and trying to become a part of a community project outside of my daily grind of DBA work.

On to more stuff!!!

Leave a Reply

Your email address will not be published. Required fields are marked *