Cover image for Windows PowerShell Pocket Reference, 2nd Edition

Book description

This portable reference to Windows PowerShell summarizes both the command shell and scripting language, and provides a concise reference to the major tasks that make PowerShell so successful. It's an ideal on-the-job tool for Windows administrators who don't have time to plow through huge books or search online.

Table of Contents

  1. Windows PowerShell Pocket Reference
  2. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
  3. 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
  4. 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
  5. 2. Regular Expression Reference
  6. 3. XPath Quick Reference
  7. 4. .NET String Formatting
    1. String Formatting Syntax
    2. Standard Numeric Format Strings
    3. Custom Numeric Format Strings
  8. 5. .NET DateTime Formatting
    1. Custom DateTime Format Strings
  9. 6. Selected .NET Classes and Their Uses
  10. 7. WMI Reference
  11. 8. Selected COM Objects and Their Uses
  12. 9. Selected Events and Their Uses
  13. 10. Standard PowerShell Verbs
  14. Index
  15. About the Author
  16. Colophon
  17. Copyright