Learning PowerShell

Today is New Year’s Eve and I thought I would put together one more PowerShell Top of the Week. This week marks the 26th Top of the Week for 2018. With brief breaks between some weeks, this post comes at just over 6 months since I began writing these tips. I hope you, the reader, are finding these to be useful. If you have any feedback, please provide it here with this blog post or send an email to feedback@practicalpowershell.com.

For this one, I wanted to take an approach of not necessarily sharing PowerShell code, but perhaps sharing how to learn scripting, how to explore what cmdlets do and how to do so safely. This is the approach I take when writing scripts for myself, for my clients and for the public. While coding comes easier now it has taken quite a few years to get here.

RESOURCES

If you are new to PowerShell here are a few resources you should be familiar with when learning PowerShell:

-PowerShell Books

There are plenty of books out there. Obvious Dave and I wrote a pair of books on Exchange/Exchange Online and PowerShell. They are not intended for the absolute beginner but someone with some command to a good command of PowerShell. There are plenty of books out there for the beginner learning PowerShell. Begin with one of these.

-PowerShell Blogs / Websites

Microsoft has it’s Scripting guys who write about PowerShell all the time. Then there are various blog writers, like myself, who write PowerShell to provide a practical path forward with PowerShell and whatever system you are running scripts against. My advice is to book mark them as you come across them and ready there PowerShell examples. There are larger named sites like PowerShell.Org that are useful to explore as well.

-Microsoft Docs / TechNet

As the creator and curator of PowerShell, of course Microsoft has a good reference library on PowerShell. There are some good How-To’s as well as explanations with examples of most/all PowerShell cmdlets available for their various products. It is worth exploring these free resources. The examples alone should provide useful in guiding your code.

-Get-Help

In addition to Docs and TechNet (which is moving to or already moved to Docs), each PowerShell environment or module has Get-Help available for each cmdlet. The get-help can provide examples, synopsis and a full list of available Parameters and Switches for the cmdlet.

-Beginning Cmdlets

Always. Always. Start with any cmdlet who’s verb is Get. Using the Get cmdlets you will be able to explore PowerShell in a non-destructive manner. Get cmdlets do not manipulate anything in your environment. With Get cmdlets you will be able to play with output formatting, input into those cmdlets and more.

EXTRA

In addition to all of the resources above, it is highly recommend that you have some sort of test environment for testing out cmdlets and scripts. Scripts can indeed have unintended consequences – like deleting attributes or mailboxes. PowerShell, with the correct rights elevation, could cause major havoc in a production environment. Build out a test environment, even if it consists of one Virtual Host Server. This will give you a leg up in proving out your code.

CONCLUSION

At the end of the day learning PowerShell and learning to script PowerShell is a journey. It’s not something you can learn in one day. However, it is a skill worth learning as it can be applied to many Microsoft Workloads – computer management, Active Directory, Exchange, Office 365 and more.

HAPPY NEW YEAR! 2019!

Related Post

A Good EndingA Good Ending

Like all good scripts, starting off well should be reciprocated with a good ending as well. What does that mean? Think processing, cleanup, ending transcripts, truncating log files and more.