27 Never the end

We’ve come to nearly the end of this book, but it’s hardly the end of your PowerShell exploration. There’s a lot more in the shell to learn, and based on what you’ve learned in this book, you’ll be able to teach yourself much of it. This short chapter will help point you in the right direction.

27.1 Ideas for further exploration

First of all, if you are a database administrator, either by trade or by accident, we highly suggest you investigate dbatools, which is a free PowerShell module with over 500 commands that can safely and quickly automate all the tasks you need to do all the time. Like the PowerShell community, the dbatools community is inviting and engaging; you can learn more about them and the module at https://dbatools.io. The team behind dbatools has also written Learn dbatools in a Month of Lunches and you can read a free chapter from that book at http://mng.bz/4jED.

This book has focused on the skills and techniques that you need to be an effective PowerShell tool user. In other words, you should be able to start accomplishing tasks using all of the thousands of commands that are available for PowerShell, whether your needs relate to Windows, Microsoft 365, SharePoint, or something else.

Your next step is to start combining commands to create automated, multistep processes, and to do so in a way that produces packaged, ready-to-use tools for other people. We call that tool making, although it’s more of a really long script or function, and it’s the topic of its own complete book, Learn PowerShell Scripting in a Month of Lunches, by Don Jones and Jeffery Hicks (Manning, 2017). But even with what you’ve learned in this book, you can produce parameterized scripts that contain as many commands as you need to complete a task—that’s the beginning of tool making. What else does tool making involve?

  • PowerShell’s simplified scripting language

  • Scope

  • Functions, and the ability to build multiple tools into a single script file

  • Error handling

  • Writing help

  • Debugging

  • Custom formatting views

  • Custom type extensions

  • Script and manifest modules

  • Using databases

  • Workflows

  • Pipeline troubleshooting

  • Complex object hierarchies

  • Globalization and localization

  • Proxy functions

  • Constrained remoting and delegated administration

  • Using .NET

There’s lots more too. If you get interested enough and have the right background skills, you may even be a part of PowerShell’s third audience: software developers. A whole set of techniques and technologies exists around developing for PowerShell, using PowerShell during development, and more. It’s a big product!

27.2 “Now that I’ve read the book, where do I start?”

The best thing to do now is pick a task. Choose something in your production world that you personally find repetitive, and automate it using the shell. Yes, it may take longer to learn how to script it out, but the second time you need it, your work will already be done for you. You’ll almost certainly run across things that you don’t know how to do, and that’s the perfect place to start learning. Here are some of the things we’ve seen other administrators tackle:

  • Write a script that changes the password that a service uses to log in, and have it target multiple computers running that service. (You could do this in a single command.)

  • Write a script that automates new user provisioning, including creating user accounts, mailboxes, and home directories.

  • Write a script that manages Exchange or M635 mailboxes in some way—perhaps getting reports on the largest mailboxes, or creating charge-back reports based on mailbox sizes.

The biggest thing to remember is to not overthink it. One PowerShell developer once met an administrator who struggled for weeks to write a robust file-copying script in PowerShell so that he could deploy content across a web server farm. “Why not just use xcopy or robocopy?” he asked. The administrator stared at him for a minute and then laughed. He’d gotten so wrapped up in “doing it in PowerShell” that he forgot that PowerShell can use all of the excellent utilities that are already out there.

27.3 Other resources you’ll grow to love

We spend a lot of time working with, writing about, and teaching PowerShell. Ask our families—sometimes we barely shut up about it long enough to eat dinner. That means we’ve accumulated a lot of online resources that we use daily and that we recommend to all of our students. Hopefully they’ll provide you with a good starting point as well:

  • https://powershell.org—This should be your first stop. You’ll find everything from Q&A forums to free e-books, free webinars, live educational events, and a lot more. It’s a central gathering place for a big chunk of the PowerShell community, including a podcast that’s run for years and years.

  • https://youtube.com/powershellorg—PowerShell.org’s YouTube channel has tons of free PowerShell videos, including sessions recorded at the PowerShell + DevOps Global Summit.

  • https://jdhitsolutions.com—This is Jeff Hick’s all-purpose scripting and PowerShell blog.

  • https://devopscollective.org—This is the parent organization for PowerShell.org, focused on the bigger-picture DevOps approach to IT management.

Students often ask if there are any other PowerShell books that we recommend. Two are Learn PowerShell Scripting in a Month of Lunches by Don Jones and Jeffery Hicks (Manning, 2017) and PowerShell in Depth, Second Edition, by Don Jones, Jeffery Hicks, and Richard Siddaway (Manning, 2014). Windows PowerShell in Action, Third Edition (Manning, 2017), is a comprehensive look at the language by one of its designers, Bruce Payette, along with Richard Siddaway, a Microsoft MVP. We also recommend PowerShell Deep Dives by Jeffery Hicks, Richard Siddaway, Oisin Grehan, and Aleksandar Nikolic (Manning, 2013), a collection of deep technical articles authored by PowerShell MVPs (proceeds from the book benefit the Save the Children charity, so please buy three copies). Finally, if you’re a fan of video training, there are plenty of PowerShell videos at http://Pluralsight.com. And Tyler has a video introduction to PowerShell, “How to Navigate the PowerShell Help System,” originally recorded for Twitch, now available for free at http://mng.bz/QW6R.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.240.80