O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning PowerShell

Book Description

Learning PowerShell is a custom-built, handcrafted, painstakingly curated book designed to get you from total PowerShell newbie to confident PowerShell user in as little as four weeks. This book assumes no prior knowledge, perfect for non-developers and GUI addicts who recognize that PowerShell is the future but need a good bit of handholding to achieve mastery. It is also a simple guide for the hundreds of thousands of PowerShell users who have not attained the level of PowerShell knowledge that they really need.

With Learning PowerShell at your side, you will see that you don't have to be a developer to use PowerShell and you don't need to be a scripting wizard to derive value from integrating PowerShell into your daily administrative activities. The book is a learning resource that covers every topic worth discussing for a PowerShell beginner, with a depth of explanation unparalleled by any book currently on the market. With this book, you don't have to have a lot of time to learn the language and you can begin applying what you master almost immediately. Even skeptics of PowerShell, and command lines in general, will come away with a renewed sense of respect for the language and ideas on how to put it to use.

Table of Contents

  1. Cover
  2. Title Page
  3. Copyright
  4. Acknowledgements
  5. Contents
  6. Chapter 1: Getting Started and Setting Up
    1. Valid Platforms and Versions
    2. Two Important PowerShell Tools
    3. The PowerShell Integrated Scripting Environment (ISE)
    4. The Windows PowerShell Console
    5. The Last Word
  7. Chapter 2: The Basics of PowerShell
    1. Some Terminology and Definitions
    2. A Little about Aliases
    3. PowerShell Command Components
    4. Knowing Which Commands to Use and How to Use Them: Getting Help
    5. Looking for Help With an Idea or Concept
    6. Full, Unrestrained, Painstakingly Detailed Help
    7. A Little Interactive Handholding: Show-Command
    8. Understanding Error Messages
    9. Always Use Protection: Stopping You from Hurting Yourself
    10. The Last Word
  8. Chapter 3: The PowerShell Pipeline
    1. Introducing the Pipeline
    2. Piping to the Screen and to Files
    3. To the Screen: Out-Host
    4. To Files: Out-File
    5. To Printers: Out-Printer
    6. Importing and Exporting Data for PowerShell to Work With
    7. Importing from Comma-Separated Values (CSV) Files
    8. Exporting to Comma-Separated Values (CSV) Files
    9. Converting Content
    10. The Last Word
  9. Chapter 4: PowerShell Providers, Modules, and Snap-ins
    1. Introducing Providers
    2. How Providers Work
    3. Provider Capabilities and Drives
    4. Items
    5. Differences in Providers Matter
    6. A Provider Example: The Registry
    7. Introducing Modules and Snap-ins
    8. Modules
    9. Snap-ins
    10. About Management Shells
    11. Your Profile: Your Favorite Snap-Ins and Modules, Automatically Loaded
    12. The Last Word
  10. Chapter 5: The Complete Beginner’s Guide to Objects
    1. What Is an Object?
    2. Properties and Methods
    3. Objects and the Pipeline
    4. Inspecting an Object’s Properties and Methods
    5. Manipulating Objects
    6. Limiting or Selecting
    7. Sorting
    8. Remembering What Kinds of Objects are in the Pipeline
    9. The Last Word
  11. Chapter 6: Filtering and Limiting
    1. Introducing Where-Object
    2. The Syntax for Where-Object
    3. Using the Where-Object Goods
    4. Getting Lists and Filtering on Them
    5. Filtering, in a Pragmatic Sense
    6. Another Example of Objects and Filtering
    7. Further Exploration
    8. The Last Word
  12. Chapter 7: Creating Simple Scripts
    1. Introducing Scripts in PowerShell
    2. Making Scripts Useful, Phase 1: Variables
    3. Making Scripts Useful, Phase 2: If/Then, Do While, and ForEach
    4. The If/Then Construct
    5. Do While Constructs
    6. The ForEach Construct
    7. Putting It All Together: Scripts to Accomplish Something Useful
    8. Method 1
    9. Method 2
    10. A Simple Backup Strategy for Smaller Exchange Environments
    11. Clearing the Requests
    12. The Last Word
  13. Chapter 8: More Work with Objects
    1. Comparing Two Objects
    2. Looking at Compare-Object
    3. Another Example
    4. Selecting Objects
    5. Selecting a Certain Number of Objects
    6. Selecting Certain Properties
    7. Grouping Objects with Common Characteristics
    8. Hash Tables
    9. PowerShell in the Real World: Grouping and Comparing Objects
    10. The Last Word
  14. Chapter 9: To the Many, To the Few - PowerShell Remoting
    1. Introducing Remoting
    2. How Remoting Works
    3. Enabling PowerShell Remoting
    4. Remoting to One Computer at a Time
    5. Remoting to Many Computers at a Time
    6. Specifying a Script File Instead of a Command
    7. Specifying a Separate List of Computers
    8. The Caveats When Using Remote Commands
    9. The Last Word
  15. Chapter 10: Useful PowerShell Tools
    1. Dell PowerGUI
    2. SAPIEN Technologies PowerShell Studio 2015
    3. Amazon AWS Tools for Windows PowerShell
    4. Microsoft Script Browser for Windows PowerShell ISE
    5. Adam Driscoll’s PowerShell Tools for Visual Studio
    6. Microsoft Windows PowerShell Web Access, via Control Panel
    7. PowerShell Training via the Microsoft Virtual Academy
    8. Master-PowerShell, an eBook from Dr. Tobias Weltner
    9. VMware vSphere PowerCLI
    10. The Last Word
  16. Chapter 11: Using PowerShell to Manage Office 365
    1. Create a Script to Open a PowerShell Session to Office 365
    2. Assign Rights to Mailboxes
    3. Converting Regular Mailboxes to Shared Mailboxes
    4. Obtaining Last Logon Times for Office 365 Accounts
    5. Onboarding a List of New Users to Your Office 365 Tenant
    6. Lock Down and Configure Sharing on a SharePoint Online Tenant
    7. Examining Who Has External Access to a SharePoint Online Site
    8. Add and Remove People from Mailing Lists (Distribution Groups)
    9. Performing a Mass Password Change
    10. Place All Mailboxes on Litigation Hold
    11. The Last Word
  17. Chapter 12: Desired State Configuration
    1. Understanding Desired State Configuration
    2. The Push and Pull Architectures
    3. Understanding Idempotence
    4. Desired State Configuration Resources
    5. The Desired State Configuration Syntax
    6. The Last Word
  18. Chapter 13: Common Administrative Tasks with PowerShell
    1. Adding Users
    2. Deleting Dangerous Content from Exchange Mailboxes
    3. Elegantly Handling Departed Employees and Memberships
    4. Create a New CSV File and Populate It with Data
    5. Easily Connect to Office 365 from Your Hybrid Deployment
  19. Appendix X: Quick Cheat Sheet of PowerShell Verbs
  20. Index