Similar authors to follow
Manage your follows
About Adam Bertram
Adam Bertram is a 20-year veteran of IT and an experienced online business professional. He’s a consultant, Microsoft MVP, blogger, trainer, author and content marketing writer for multiple technology companies. Catch up on Adam’s articles at adamtheautomator.com, connect on LinkedIn, or follow him on Twitter at @adbertram.
Customers Also Bought Items By
Save Time. Automate.
PowerShell® is both a scripting language and an administrative shell that lets you control and automate nearly every aspect of IT. In PowerShell for Sysadmins, five-time Microsoft® MVP "Adam the Automator" Bertram shows you how to use PowerShell to manage and automate your desktop and server environments so that you can head out for an early lunch.
You'll learn how to:
• Combine commands, control flow, handle errors, write scripts, run scripts remotely, and test scripts with the PowerShell testing framework, Pester
• Parse structured data like XML and JSON, work with common domains (like Active Directory, Azure, and Amazon Web Services), and create a real-world server inventory script
• Design and build a PowerShell module to demonstrate PowerShell isn't just about ad-hoc scripts
• Use PowerShell to create a hands-off, completely automated Windows deployment
• Build an entire Active Directory forest from nothing but a Hyper-V host and a few ISO files
• Create endless Web and SQL servers with just a few lines of code!
Real-world examples throughout help bridge the gap between theory and actual system, and the author's anecdotes keep things lively.
Stop with the expensive software and fancy consultants. Learn how to manage your own environment with PowerShell for Sysadmins and make everyone happy.
Covers Windows PowerShell v5.1
Learn to write better PowerShell code via short, example-driven tips. This book covers tips to make your PowerShell scripts faster and easier to read all while following proven best practices. Written by a six-time Microsoft MVP and one of the first Microsoft PowerShell MVPs with over a decade of PowerShell experience, Building Better PowerShell Code gives you easily digestible tips you can begin using immediately.
The book starts with an overview of some of the most important tips the author can muster which segues into a deeper dive with dozens of examples throughout the book. It takes you through tips such as using community modules, writing better comments, thinking of PowerShell functions as building blocks, and more. You will also see how to use parameters the right way and how to create simple logging code to easily record script activity.
You will learn not only how to write better code, but also how to implement some mindset tricks, such as being explicit and specific with code and how to write code that reads well. You’ll get into error handling and also how to make your scripts more secure. Finally, you’ll examine the concept of building PowerShell tools and how to build scripts for speed.
Other tips and best practices include:
- Building Pester tests
- Improving performance through parallel processing
- Writing cross-platform scripts
- Using filtering properly
After reading this book and applying these tips, you will have an expert coding mindset and be able to build PowerShell code that’s efficient, readable, and compliant with many best practices.
What You Will Learn
- Implement error handling
- Create a logging function
- Use regular expressions to search strings Implement parallel processing
Who This Book Is For
PowerShell script developers.
We'll cover everything you need to know from knowing nothing about Pester and testing PowerShell scripts to becoming a testing master!
Part 1 covers the core syntax of Pester and introduces you to various possible use cases for the different syntax elements. It's enough to get you up and running if you're familiar with unit testing, or if you want to give Pester a spin.
Part 2 will take that syntax and dig into the world of unit testing and test-driven development, through a series of real-world walkthroughs. Some of these will be "stream of consciousness," following the actual process someone might use to add or develop Pester tests. This part will also cover using Pester for infrastructure validation in an "infrastructure from code" environment.
Part 3 will introduce you to Gherkin. Gherkin is another style of test writing that comes with Pester. This part will introduce you to Gherkin, how it's different than Pester test design and how it integrates with Pester.
Part 4 will tackle code coverage, an important topic to help make sure you're testing all of your code but with some not-so-obvious gotchas, you need to watch out for.
Part 5 will be more of a "cookbook," with recipes for testing specific types of situations. You will find many different, specific use-cases in here and how to test for them.