Contents in Detail
POWERSHELL FOR SYSADMINS
Workflow Automation Made Easy
by Adam Bertram
San Francisco
POWERSHELL FOR SYSADMINS. Copyright 2020 by Adam Bertram.
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.
ISBN-10: 1-59327-918-3
ISBN-13: 978-1-59327-918-9
Publisher: William Pollock
Production Editor: Janelle Ludowise
Cover Illustration: Josh Ellingson
Interior Design: Octopod Studios
Developmental Editors: Alex Freed and Zach Lebowski
Technical Reviewer: Jeffery Hicks
Copyeditor: Sharon Wilkey
Compositor: Danielle Foster
Proofreader: James M. Fraleigh
Indexer: Beth Nauman-Montana
For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900;
www.nostarch.com
Library of Congress Cataloging-in-Publication Data
Names: Bertram, Adam Richard author.
Title: PowerShell for sysadmins / Adam Bertram.
Description: San Francisco, CA : No Starch Press, 2020. | Includes
bibliographical references and index. | Summary: "A practical guide to
using PowerShell. Begins with an introduction for new users, then moves
on to explaining how to develop scripts to automate daily tasks, and
finally teaches how to build a large project to automate server
deployments from scratch."-- Provided by publisher.
Identifiers: LCCN 2019041874 (print) | LCCN 2019041875 (ebook) | ISBN
9781593279189 (paperback) | ISBN 9781593279196 (ebook)
Subjects: LCSH: Windows PowerShell (Computer program language) | Computer
networks--Management. | Computer systems.
Classification: LCC QA76.73.W56 B47 2020 (print) | LCC QA76.73.W56
(ebook) | DDC 005.4/22--dc23
LC record available at https://lccn.loc.gov/2019041874
LC ebook record available at https://lccn.loc.gov/2019041875
No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The information in this book is distributed on an As Is basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it.
To those that question the status quo, fight the thats the way weve always done it company culture, and always come up with a better solution to problems, this book is dedicated to you.
About the Author
Adam Bertram is a 20-year veteran of IT and an experienced online business professional. Hes an entrepreneur, IT influencer, Microsoft MVP, blogger, trainer, author, and content marketing writer for multiple technology companies. Adam is also the founder of the popular IT career development platform TechSnips (https://techsnips.io/).
About the Technical Reviewer
Jeffery Hicks is an IT veteran with almost 30 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award. Jeff has taught and presented on PowerShell and the benefits of automation to IT professionals worldwide. He works today as an independent author, teacher, and consultant.
BRIEF CONTENTS
ACKNOWLEDGMENTS
I couldnt have written this book and accomplished everything I have without the support of my wife, Miranda. Time is a precious commodity and because of her, one I have more of than many others. Miranda is the CEO of the Bertram household. She has somehow managed our two daughters, kept a tidy house, and kept us all fed for the years Ive been out focusing my career and helping our family prosper. Theres no way I could have accomplished all that I have with my work if she werent there supporting me and our kids.
I also want to thank Jeffrey Snover for creating the PowerShell scripting language, which has truly changed my life; Jeff Hicks, Don Jones, and Jason Helmick for inspiring me to get more involved with a community; and Microsoft for supporting crazy overachievers with their Microsoft MVP program and other initiatives.
INTRODUCTION
Throughout my career in IT, Ive worked a diverse range of jobs: Ive been in the trenches answering calls on the help desk, visited users to tell them to reboot as a technician, kept servers up as a systems administrator, designed and built solutions as a systems engineer, and learned the difference between OSPF and RIP routing as a network engineer.
It wasnt until I discovered PowerShell that I realized how passionate I could be for a particular technology. PowerShell has changed my life in more ways than one, and its the technology thats changed the trajectory of my career most dramatically. This language helped me be a critical asset at my job by knowing how to save countless hours of my teams work, and it got me my first six-figure salary. PowerShell is just so cool that I decided I had to share it with the world, and since then, Ive been awarded the prestigious Microsoft MVP award for five years straight.
In this book, Ill show you how to use PowerShell to automate thousands of tasks, build custom tools instead of buying off-the-shelf products, and link various tools together. You may not be interested in becoming an active member of the PowerShell community, but I guarantee that learning PowerShell will give you skills that many businesses need and actively seek.
Why PowerShell?
Once called Monad (see https://www.jsnover.com/Docs/MonadManifesto.pdf) and pitched as a more intuitive way to automate tasks than VBScript in 2003, Microsoft PowerShell is a universal automation, scripting, and development language. PowerShell was created to bridge the gap between scripting, automation, and operations personnel. It was meant to enable users to automate tasks with scripts without having to learn computer programming. This makes it particularly useful for system administrators who lack a background in software development. If youre a system administrator with not enough time to get everything done, PowerShell is a great ally to have.
PowerShell has now become an open source, ubiquitous, cross-platform scripting and development language. You can use PowerShell not only to provision fully configured server farms, but also to create a text file or set a registry key. Thousands of software products and services have PowerShell support now, thanks to its ever-increasing adoption rate among IT professionals, developers, DevOps engineers, database administrators, and systems engineers.