Windows PowerShell Pocket Reference, 2nd Edition

Book description

This portable reference to Windows PowerShell 3.0 summarizes the command shell and scripting language, and provides a concise reference to the many tasks that make PowerShell so useful. If you’re a busy Windows administrator, and don’t have time to plow through huge books or search online, this is the ideal on-the-job tool.

Written by Microsoft PowerShell team member Lee Holmes, and excerpted from his Windows PowerShell Cookbook, this edition offers up-to-date coverage of PowerShell 3.0. You’ll find information on the .NET classes and legacy tools you need to manage your system, along with chapters on how to write scripts, manage errors, and format output.

Beginning with a guided tour of Windows PowerShell, this handy guide covers:

  • PowerShell language and environment
  • Regular expression reference
  • XPath quick reference
  • .NET string formatting
  • .NET DateTime formatting
  • Selected .NET classes and their uses
  • WMI reference
  • Selected COM objects and their uses
  • Selected events and their uses
  • Standard PowerShell verbs

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1.  
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
  2. 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
  3. 1. PowerShell Language and Environment
    1. Commands and Expressions
    2. Comments
    3. Help Comments
    4. Variables
    5. Booleans
    6. Strings
      1. Literal and Expanding Strings
      2. Here Strings
      3. Escape Sequences
    7. Numbers
      1. Simple Assignment
      2. Administrative Numeric Constants
      3. Hexadecimal and Other Number Bases
      4. Large Numbers
      5. Imaginary and Complex Numbers
    8. Arrays and Lists
      1. Array Definitions
      2. Array Access
      3. Array Slicing
    9. Hashtables (Associative Arrays)
      1. Hashtable Definitions
      2. Hashtable Access
    10. XML
    11. Simple Operators
      1. Arithmetic Operators
      2. Logical Operators
      3. Binary Operators
      4. Other Operators
    12. Comparison Operators
    13. Conditional Statements
      1. if, elseif, and else Statements
      2. switch Statements
    14. Looping Statements
      1. for Statement
      2. foreach Statement
      3. while Statement
      4. do … while Statement/do … until Statement
      5. Flow Control Statements
        1. break
        2. continue
      6. Workflow-Specific Statements
        1. InlineScript
        2. Parallel/Sequence
        3. foreach -parallel
    15. Working with the .NET Framework
      1. Static Methods
      2. Instance Methods
      3. Explicitly Implemented Interface Methods
      4. Static Properties
      5. Instance Properties
      6. Learning About Types
        1. The Get-Member cmdlet
        2. .NET Framework documentation
      7. Type Shortcuts
      8. Creating Instances of Types
      9. Interacting with COM Objects
      10. Extending Types
        1. The Add-Member cmdlet
        2. Custom type extension files
    16. Writing Scripts, Reusing Functionality
      1. Writing Commands
        1. Writing scripts
        2. Writing functions
        3. Writing script blocks
      2. Running Commands
        1. Invoking
        2. Dot-sourcing
        3. Parameters
      3. Providing Input to Commands
        1. Argument array
        2. Formal parameters
        3. Command behavior customizations
        4. Parameter attribute customizations
        5. Parameter validation attributes
        6. Pipeline input
        7. Cmdlet keywords in commands
        8. $MyInvocation automatic variable
      4. Retrieving Output from Commands
        1. Pipeline output
        2. Return statement
        3. Exit statement
      5. Help Documentation
    17. Managing Errors
      1. Nonterminating Errors
      2. Terminating Errors
    18. Formatting Output
      1. Custom Formatting Files
    19. Capturing Output
    20. Common Customization Points
      1. Console Settings
        1. Adjust your window size
        2. Make text selection easier
        3. Use hotkeys to operate the shell more efficiently
      2. Profiles
      3. Prompts
      4. Tab Completion
      5. User Input
      6. Command Resolution
  4. 2. Regular Expression Reference
  5. 3. XPath Quick Reference
  6. 4. .NET String Formatting
    1. String Formatting Syntax
    2. Standard Numeric Format Strings
    3. Custom Numeric Format Strings
  7. 5. .NET DateTime Formatting
    1. Custom DateTime Format Strings
  8. 6. Selected .NET Classes and Their Uses
  9. 7. WMI Reference
  10. 8. Selected COM Objects and Their Uses
  11. 9. Selected Events and Their Uses
  12. 10. Standard PowerShell Verbs
  13. Index
  14. About the Author
  15. Colophon
  16. Copyright

Product information

  • Title: Windows PowerShell Pocket Reference, 2nd Edition
  • Author(s): Lee Holmes
  • Release date: December 2012
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449320966