About This eBook
ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturers Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the eBook in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a Click here to view code image link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
Sams Teach Yourself
Windows PowerShell
in 24 Hours
Timothy Warner
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Sams Teach Yourself Windows PowerShell in 24 Hours
Copyright 2015 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 9780672337284
ISBN-10: 0672337282
Library of Congress Control Number: 2015900973
Printed in the United States of America
First Printing May 2015
Editor-in-Chief
Greg Wiegand
Acquisitions Editor
Joan Murray
Development Editor
Sondra Scott
Managing Editor
Kristy Hart
Project Editor
Andy Beaster
Copy Editor
Keith Cline
Indexer
Cheryl Lenser
Proofreader
Katie Matejka
Technical Editor
Jeff Wouters
Publishing Coordinator
Cindy Teeters
Cover Designer
Mark Shirar
Compositor
Gloria Schurick
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Special Sales
For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at or (800) 382-3419.
For government sales inquiries, please contact .
For questions about sales outside the U.S., please contact .
Contents at a Glance
Table of Contents
About the Author
Timothy Warner is an IT professional and technical trainer based in Nashville, Tennessee. Tim became acquainted with information technology in 1982 when his dad bought the family a Timex Sinclair 1000 home computer and he taught himself BASIC programming. Today he works as an author/evangelist for Pluralsight and shares Windows PowerShell knowledge with anyone wholl listen at his Two Minute PowerShell blog: http://2minutepowershell.com. You can reach Tim directly via LinkedIn: http://linkedin.com/in/timothywarner.
Dedication
To all my students, past and present.
Thank you for giving me a professional calling,
and I hope that my work helps you attain your goals.
Acknowledgments
The Windows PowerShell community is a terrific group of people. Thank you, Jeffrey Snover, Bruce Payette, and Lee Holmes et al. for giving the world Windows PowerShell. Thanks to all the PowerShell experts in the world for being so kind and willing to share your knowledge. I seek to emulate your actions every day.
It may take a village to raise a child, but I know that it takes a large office full of talented professionals to publish a book. To that end, I want to thank my wonderful editor Joan Murray for having faith in my abilities. Thanks to my publisher, Greg Wiegand, for being so receptive to my ideas.
Editorial and production staff rarely receive the credit they deserve. Thanks so much to Windows PowerShell MVP Jeff Wouters, my technical editor, for being so thorough with the manuscript. Truly, this book is at least twice as good as it originally was thanks to you.
Thanks to Keith Cline, my copyeditor, for making my writing easier to follow. Keith knows that I gave his editing skills quite a workout, for sure. Sorry, Keith!
I extend my gratitude as well to Andy Beaster, my production editor, and to the ever-helpful Cindy Teeters for streamlining the entire book publishing process. Andy and Cindy are professionals in every sense of the word.
Thanks to my family, friends, and colleagues for your never-ending love and support. Finally, thank you, my reader. I hope that this book helps you accomplish your next professional goal.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what were doing right, what we could do better, what areas youd like to see us publish in, and any other words of wisdom youre willing to pass our way.
We welcome your comments. You can email or write to let us know what you did or didnt like about this bookas well as what we can do to make our books better.
Please note that we cannot help you with technical problems related to the topic of this book.
When you write, please be sure to include this books title and author as well as your name and email address. We will carefully review your comments and share them with the author and editors who worked on the book.
Email: consumer@samspublishing.com
Mail: Sams Publishing
ATTN: Reader Feedback
800 East 96th Street
Indianapolis, IN 46240 USA
Reader Services
Visit our website and register this book at informit.com/register for convenient access to any updates, downloads, or errata that might be available for this book.
Introduction
Try not. Do...or do not. There is no try
Yoda, Star Wars Episode V: The Empire Strikes Back
Hello, and welcome to the world of Windows PowerShell. Im your instructor, Tim Warner. To me, its a good sign that youre actually reading this Introduction (so few readers of tech books do, in my experience). Perhaps your first question is, Whats in it for me? and Im here to give you those details with minimal muss and fuss.