Books & Videos

Table of Contents

  1. Tour

    1. A Guided Tour of Windows PowerShell

      1. Introduction
      2. An Interactive Shell
      3. Structured Commands (Cmdlets)
      4. Deep Integration of Objects
      5. Administrators As First-Class Users
      6. Composable Commands
      7. Techniques to Protect You from Yourself
      8. Common Discovery Commands
      9. Ubiquitous Scripting
      10. Ad Hoc Development
      11. Bridging Technologies
      12. Namespace Navigation Through Providers
      13. Much, Much More
  2. Fundamentals

    1. Chapter 1 The Windows PowerShell Interactive Shell

      1. Introduction
      2. Run Programs, Scripts, and Existing Tools
      3. Run a PowerShell Command
      4. Customize Your Shell, Profile, and Prompt
      5. Find a Command to Accomplish a Task
      6. Get Help on a Command
      7. Program: Search Help for Text
      8. Invoke a PowerShell Script From Outside PowerShell
      9. Program: Retain Changes to Environment Variables Set by a Batch File
      10. Get the System Date and Time
      11. Determine the Status of the Last Command
      12. Measure the Duration of a Command
      13. Customize the Shell to Improve Your Productivity
      14. Program: Learn Aliases for Common Commands
      15. Access and Manage Your Console History
      16. Store the Output of a Command into a File
      17. Add Information to the End of a File
      18. Record a Transcript of Your Shell Session
      19. Display the Properties of an Item As a List
      20. Display the Properties of an Item As a Table
      21. Manage the Error Output of Commands
      22. Configure Debug, Verbose, and Progress Output
      23. Extend Your Shell with Additional Snapins
      24. Use Console Files to Load and Save Sets of Snapins
    2. Chapter 2 Pipelines

      1. Introduction
      2. Filter Items in a List or Command Output
      3. Program: Simplify Most Where-Object Filters
      4. Program: Interactively Filter Lists of Objects
      5. Work with Each Item in a List or Command Output
      6. Automate Data-Intensive Tasks
    3. Chapter 3 Variables and Objects

      1. Introduction
      2. Store Information in Variables
      3. Access Environment Variables
      4. Control Access and Scope of Variables and Other Items
      5. Work with .NET Objects
      6. Create an Instance of a .NET Object
      7. Program: Create Instances of Generic Objects
      8. Reduce Typing for Long Class Names
      9. Use a COM Object
      10. Learn About Types and Objects
      11. Get Detailed Documentation About Types and Objects
      12. Add Custom Methods and Properties to Objects
      13. Add Custom Methods and Properties to Types
    4. Chapter 4 Looping and Flow Control

      1. Introduction
      2. Make Decisions with Comparison and Logical Operators
      3. Adjust Script Flow Using Conditional Statements
      4. Manage Large Conditional Statements with Switches
      5. Repeat Operations with Loops
      6. Add a Pause or Delay
    5. Chapter 5 Strings and Unstructured Text

      1. Introduction
      2. Create a String
      3. Create a Multiline or Formatted String
      4. Place Special Characters in a String
      5. Insert Dynamic Information in a String
      6. Prevent a String from Including Dynamic Information
      7. Place Formatted Information in a String
      8. Search a String for Text or a Pattern
      9. Replace Text in a String
      10. Convert a String to Upper/Lowercase
      11. Trim a String
      12. Format a Date for Output
      13. Program: Convert Text Streams to Objects
      14. Generate Large Reports and Text Streams
    6. Chapter 6 Calculations and Math

      1. Introduction
      2. Perform Simple Arithmetic
      3. Perform Complex Arithmetic
      4. Measure Statistical Properties of a List
      5. Work with Numbers As Binary
      6. Simplify Math with Administrative Constants
      7. Convert Numbers Between Bases
  3. Common Tasks

    1. Chapter 7 Simple Files

      1. Introduction
      2. Get the Content of a File
      3. Search a File for Text or a Pattern
      4. Parse and Manage Text-Based Logfiles
      5. Parse and Manage Binary Files
      6. Create a Temporary File
      7. Search and Replace Text in a File
    2. Chapter 8 Structured Files

      1. Introduction
      2. Access Information in an XML File
      3. Perform an XPath Query Against an XML File
      4. Modify Data in an XML File
      5. Easily Import and Export Your Structured Data
      6. Store the Output of a Command in a CSV File
      7. Import Structured Data from a CSV File
      8. Use Excel to Manage Command Output
    3. Chapter 9 Internet-Enabled Scripts

      1. Introduction
      2. Download a File from the Internet
      3. Download a Web Page from the Internet
      4. Program: Get-PageUrls
      5. Program: Connect-WebService
      6. Export Command Output As a Web Page
      7. Program: Send an Email
      8. Program: Interact with Internet Protocols
    4. Chapter 10 Code Reuse

      1. Introduction
      2. Write a Script
      3. Write a Function
      4. Write a Script Block
      5. Return Data from a Script, Function, or Script Block
      6. Place Common Functions in a Library
      7. Access Arguments of a Script, Function, or Script Block
      8. Access Pipeline Input
      9. Write Pipeline-Oriented Scripts with Cmdlet Keywords
      10. Write a Pipeline-Oriented Function
    5. Chapter 11 Lists, Arrays, and Hashtables

      1. Introduction
      2. Create an Array or List of Items
      3. Create a Jagged or Multidimensional Array
      4. Access Elements of an Array
      5. Visit Each Element of an Array
      6. Sort an Array or List of Items
      7. Determine Whether an Array Contains an Item
      8. Combine Two Arrays
      9. Find Items in an Array That Match a Value
      10. Remove Elements from an Array
      11. Find Items in an Array Greater or Less Than a Value
      12. Use the ArrayList Class for Advanced Array Tasks
      13. Create a Hashtable or Associative Array
      14. Sort a Hashtable by Key or Value
    6. Chapter 12 User Interaction

      1. Introduction
      2. Read a Line of User Input
      3. Read a Key of User Input
      4. Program: Display a Menu to the User
      5. Display Messages and Output to the User
      6. Provide Progress Updates on Long-Running Tasks
      7. Write Culture-Aware Scripts
      8. Program: Invoke a Script Block with Alternate Culture Settings
      9. Access Features of the Host's User Interface
      10. Program: Add a Graphical User Interface to Your Script
    7. Chapter 13 Tracing and Error Management

      1. Introduction
      2. View the Errors Generated by a Command
      3. Handle Warnings, Errors, and Terminating Errors
      4. Output Warnings, Errors, and Terminating Errors
      5. Debug a Script
      6. Collect Detailed Traces of a Script or Command
      7. Program: Analyze a Script's Performance Profile
    8. Chapter 14 Environmental Awareness

      1. Introduction
      2. View and Modify Environment Variables
      3. Access Information About Your Command's Invocation
      4. Program: Investigate the InvocationInfo Variable
      5. Find Your Script's Name
      6. Find Your Script's Location
      7. Find the Location of Common System Paths
      8. Program: Search the Windows Start Menu
      9. Get the Current Location
      10. Safely Build File Paths Out of Their Components
      11. Interact with PowerShell's Global Environment
    9. Chapter 15 Extend the Reach of Windows PowerShell

      1. Introduction
      2. Access Windows Management Instrumentation Data
      3. Program: Determine Properties Available to WMI Filters
      4. Program: Search for WMI Classes
      5. Use .NET to Perform Advanced WMI Tasks
      6. Convert a VBScript WMI Script to PowerShell
      7. Automate Programs Using COM Scripting Interfaces
      8. Program: Query a SQL Data Source
      9. Access Windows Performance Counters
      10. Program: Invoke Native Windows API Calls
      11. Program: Add Inline C# to Your PowerShell Script
      12. Access a .NET SDK Library
      13. Create Your Own PowerShell Cmdlet
      14. Add PowerShell Scripting to Your Own Program
    10. Chapter 16 Security and Script Signing

      1. Introduction
      2. Enable Scripting Through an Execution Policy
      3. Sign a PowerShell Script or Formatting File
      4. Program: Create a Self-Signed Certificate
      5. Manage PowerShell Security in an Enterprise
      6. Verify the Digital Signature of a PowerShell Script
      7. Securely Handle Sensitive Information
      8. Securely Request Usernames and Passwords
      9. Program: Start a Process As Another User
      10. Securely Store Credentials on Disk
      11. Access User and Machine Certificates
      12. Program: Search the Certificate Store
  4. Administrator Tasks

    1. Chapter 17 Files and Directories

      1. Introduction
      2. Find All Files Modified Before a Certain Date
      3. Clear or Remove a File
      4. Manage and Change the Attributes of a File
      5. Get the Files in a Directory
      6. Find Files That Match a Pattern
      7. Manage Files That Include Special Characters
      8. Program: Get Disk Usage Information
      9. Determine the Current Location
      10. Monitor a File for Changes
      11. Program: Get the MD5 or SHA1 Hash of a File
      12. Create a Directory
      13. Remove a File or Directory
      14. Rename a File or Directory
      15. Move a File or Directory
      16. Get the ACL of a File or Directory
      17. Set the ACL of a File or Directory
      18. Program: Add Extended File Properties to Files
      19. Program: Create a Filesystem Hard Link
      20. Program: Create a ZIP Archive
    2. Chapter 18 The Windows Registry

      1. Introduction
      2. Navigate the Registry
      3. View a Registry Key
      4. Modify or Remove a Registry Key Value
      5. Create a Registry Key Value
      6. Remove a Registry Key
      7. Add a Site to an Internet Explorer Security Zone
      8. Modify Internet Explorer Settings
      9. Program: Search the Windows Registry
      10. Get the ACL of a Registry Key
      11. Set the ACL of a Registry Key
      12. Work with the Registry of a Remote Computer
      13. Program: Get Registry Items from Remote Machines
      14. Program: Get Properties of Remote Registry Keys
      15. Program: Set Properties of Remote Registry Keys
      16. Discover Registry Settings for Programs
    3. Chapter 19 Comparing Data

      1. Introduction
      2. Compare the Output of Two Commands
      3. Determine the Differences Between Two Files
      4. Verify Integrity of File Sets
    4. Chapter 20 Event Logs

      1. Introduction
      2. List All Event Logs
      3. Get the Newest Entries from an Event Log
      4. Find Event Log Entries with Specific Text
      5. Retrieve a Specific Event Log Entry
      6. Find Event Log Entries by Their Frequency
      7. Back Up an Event Log
      8. Create or Remove an Event Log
      9. Write to an Event Log
      10. Access Event Logs of a Remote Machine
    5. Chapter 21 Processes

      1. Introduction
      2. List Currently Running Processes
      3. Launch a Process
      4. Stop a Process
      5. Program: Invoke a PowerShell Expression on a Remote Machine
    6. Chapter 22 System Services

      1. Introduction
      2. List All Running Services
      3. Manage a Running Service
      4. Access Services on a Remote Machine
    7. Chapter 23 Active Directory

      1. Introduction
      2. Test Active Directory Scripts on a Local Installation
      3. Create an Organizational Unit
      4. Get the Properties of an Organizational Unit
      5. Modify Properties of an Organizational Unit
      6. Get the Children of an Active Directory Container
      7. Create a User Account
      8. Search for a User Account
      9. Get and List the Properties of a User Account
      10. Modify Properties of a User Account
      11. Create a Security or Distribution Group
      12. Search for a Security or Distribution Group
      13. Get the Properties of a Group
      14. Find the Owner of a Group
      15. Modify Properties of a Security or Distribution Group
      16. Add a User to a Security or Distribution Group
      17. Remove a User from a Security or Distribution Group
      18. List a User's Group Membership
      19. List the Members of a Group
      20. List the Users in an Organizational Unit
      21. Search for a Computer Account
      22. Get and List the Properties of a Computer Account
    8. Chapter 24 Enterprise Computer Management

      1. Introduction
      2. Program: List Logon or Logoff Scripts for a User
      3. Program: List Startup or Shutdown Scripts for a Machine
      4. Enable or Disable the Windows Firewall
      5. Open or Close Ports in the Windows Firewall
      6. Program: List All Installed Software
      7. Uninstall an Application
      8. Manage Scheduled Tasks on a Computer
      9. Retrieve Printer Information
      10. Retrieve Printer Queue Statistics
      11. Manage Printers and Print Queues
      12. Determine Whether a Hotfix Is Installed
      13. Program: Summarize System Information
      14. Renew a DHCP Lease
      15. Assign a Static IP Address
      16. List All IP Addresses for a Computer
      17. List Network Adapter Properties
    9. Chapter 25 Manage an Exchange 2007 Server

      1. Introduction
      2. Experiment with Exchange Management Shell
      3. Automate Wizard-Guided Tasks
      4. Manage Exchange Users
      5. Manage Mailboxes
      6. Manage Distribution Groups
      7. Manage Transport Rules
      8. Manage Outlook Web Access
    10. Chapter 26 Manage an Operations Manager 2007 Server

      1. Introduction
      2. Experiment with the Command Shell
      3. Manage Operations Manager Agents
      4. Schedule a Maintenance Window
      5. Get, Install, and Uninstall Management Packs
      6. Enable or Disable Rules
      7. List and Start Tasks
      8. Manage Alerts
  5. References

    1. Appendix PowerShell Language and Environment

      1. Commands and Expressions
      3. Variables
      4. Booleans
      5. Strings
      6. Numbers
      7. Arrays and Lists
      8. Hashtables (Associative Arrays)
      9. XML
      10. Simple Operators
      11. Comparison Operators
      12. Conditional Statements
      13. Looping Statements
      14. Working with the .NET Framework
      15. Writing Scripts, Reusing Functionality
      16. Managing Errors
      17. Formatting Output
      18. Capturing Output
      19. Tracing and Debugging
      20. Common Customization Points
    2. Appendix Regular Expression Reference

    3. Appendix PowerShell Automatic Variables

    4. Appendix Standard PowerShell Verbs

    5. Appendix Selected .NET Classes and Their Uses

    6. Appendix WMI Reference

    7. Appendix Selected COM Objects and Their Uses

    8. Appendix .NET String Formatting

      1. String Formatting Syntax
      2. Standard Numeric Format Strings
      3. Custom Numeric Format Strings
    9. Appendix .NET DateTime Formatting

      1. Custom DateTime Format Strings
  1. Colophon