You are previewing Windows Powershell Pocket Reference.
O'Reilly logo
Windows Powershell Pocket Reference

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. Written by Microsoft PowerShell team member Lee Holmes, and excerpted from his Windows PowerShell Cookbook, Windows PowerShell Pocket Reference offers up-to-date coverage of PowerShell's 1.0 release. You'll find information on .NET classes and legacy management tools that you need to manage your system, along with chapters on how to write scripts, manage errors, format output, and much more. Beginning with a whirlwind tour of Windows PowerShell, this convenient guide covers:

  • PowerShell language and environment

  • Regular expression reference

  • PowerShell automatic variables

  • Standard PowerShell verbs

  • Selected .NET classes and their uses

  • WMI reference

  • Selected COM objects and their uses

  • .NET string formatting

  • .NET datetime formatting

  • An authoritative source of information about PowerShell since its earliest betas, Lee Holmes' vast experience lets him incorporate both the "how" and the "why" into the book's discussions. His relationship with the PowerShell and administration community -- through newsgroups, mailing lists, and his informative blog Lee Holmes -- gives him insight into problems faced by administrators and PowerShell users alike.

    If you're ready to learn this powerful tool without having to break stride in your routine, this is the book you want.

    Table of Contents

    1. Special Upgrade Offer
    2. Preface
      1. Font Conventions
      2. Comments and Questions
      3. Safari® Books Online
    3. 1. A Whirlwind 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. 2. PowerShell Language and Environment
      1. Commands and Expressions
      2. Comments
      3. Variables
      4. Booleans
      5. Strings
        1. Literal and Expanding Strings
        2. Here Strings
        3. Escape Sequences
      6. Numbers
        1. Simple Assignment
        2. Administrative Numeric Constants
        3. Hexadecimal and Other Number Bases
      7. Arrays and Lists
        1. Array Definitions
        2. Array Access
        3. Array Slicing
      8. Hashtables (Associative Arrays)
        1. Hashtable Definitions
        2. Hashtable Access
      9. XML
      10. Simple Operators
        1. Arithmetic Operators
        2. Logical Operators
        3. Binary Operators
        4. Other Operators
      11. Comparison Operators
      12. Conditional Statements
        1. if, elseif, and else Statements
        2. switch Statements
      13. 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
      14. Working with the .NET Framework
        1. Static Methods
        2. Instance Methods
        3. Static Properties
        4. Instance Properties
        5. Learning About Types
          1. The Get-Member cmdlet
          2. .NET Framework documentation
        6. Type Shortcuts
        7. Creating Instances of Types
        8. Interacting with COM Objects
        9. Extending Types
          1. The Add-Member cmdlet
          2. Custom type extension files
      15. Writing Scripts, Reusing Functionality
        1. Writing Scripts
        2. Running Scripts
          1. Invoking
          2. Dot-sourcing
        3. Providing Input to Scripts
          1. Argument array
          2. Formal parameters
          3. Pipeline input
          4. Cmdlet keywords in scripts
          5. $MyInvocation automatic variable
        4. Retrieving Output from Scripts
          1. Pipeline output
          2. Return statement
          3. Exit statement
        5. Functions
        6. Script Blocks
      16. Managing Errors
        1. Nonterminating Errors
        2. Terminating Errors
      17. Formatting Output
        1. Custom formatting files
          1. Custom formatting files
      18. Capturing Output
      19. Tracing and Debugging
        1. The Set-PsDebug Cmdlet
        2. The Trace-Command Cmdlet
        3. The Verbose Cmdlet 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. 3. Regular Expression Reference
    6. 4. PowerShell Automatic Variables
    7. 5. Standard PowerShell Verbs
    8. 6. Selected .NET Classes and Their Uses
    9. 7. WMI Reference
    10. 8. Selected COM Objects and Their Uses
    11. 9. .NET String Formatting
      1. String Formatting Syntax
      2. Standard Numeric Format Strings
      3. Custom Numeric Format Strings
    12. 10. .NET DateTime Formatting
      1. Custom DateTime Format Strings
    13. Index
    14. About the Author
    15. Special Upgrade Offer
    16. Copyright