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

Professional Windows® PowerShell

Book Description

  • MSH is a new command-line shell for Microsoft server products, including the long-awaited Longhorn server, and will eventually ship with all major Microsoft products, making it the must-know technology

  • MSH will replace current command lines in new Microsoft products and can be used to write shell scripts similar to those used with Unix and Linux

  • Discusses how MSH enables all of the .NET Framework objects to become accessible via scripting, making it a very powerful addition to any developer's or administrator's toolbox

  • Readers are guided through all the ins and outs of MSH and learn how to create powerful solutions; run scripts, programs, and commands; customize the MSH environment; handle data; manage files and disks; and script solutions and .NET objects

  • Table of Contents

    1. Copyright
    2. Dedication
    3. About the Author
    4. Introduction
    5. Acknowledgments
    6. Finding Your Way Around Windows PowerShell
      1. Getting Started with Windows PowerShell
        1. Installing Windows PowerShell
        2. Starting and Stopping PowerShell
        3. Finding Available Commands
        4. Getting Help
        5. Basic Housekeeping
        6. Case Insensitivity
        7. What You Get in PowerShell
        8. Summary
      2. The Need for Windows PowerShell
        1. Limitations of CMD.exe
        2. The GUI Emphasis in Windows
        3. Previous Attempted Solutions
        4. Summary
      3. The Windows PowerShell Approach
        1. A New Architecture
        2. A New Cross-Tool Approach
        3. Namespaces as Drives
        4. Extensibility and Backward Compatibility
        5. Object-Based Approach in PowerShell
        6. A Consistent Verb-Noun Naming Scheme
        7. Coping with a Diverse World
        8. Upgrade Path to C#
        9. Working with Errors
        10. Debugging in PowerShell
        11. Additional PowerShell Features
        12. Summary
      4. Using the Interactive Shell
        1. Windows PowerShell's Two Command Line Parsing Approaches
        2. Exploring a Windows System with Windows PowerShell
        3. Using Abbreviated Commands
        4. Working with Object Pipelines
        5. Pros and Cons of Verbosity
        6. Summary
      5. Using Snapins, Startup Files, and Preferences
        1. Startup
        2. Profiles
        3. Aliases
        4. Prompts
        5. Preference Variables
        6. Summary
      6. Parameters
        1. Using Parameters
        2. Common Parameters
        3. Using Variables as Parameters
        4. Summary
      7. Filtering and Formatting Output
        1. Using the where-object Cmdlet
        2. Using the select-object Cmdlet
        3. Default Formatting
        4. Using the format-table Cmdlet
        5. Using the format-list Cmdlet
        6. Using the update-formatdata and update-typedata Cmdlets
        7. Summary
      8. Using Trusting Operations
        1. Look Before You Leap
        2. Using the remove-item Cmdlet
        3. Using the whatif Parameter
        4. Using the confirm Parameter
        5. Using the verbose Parameter
        6. Summary
      9. Retrieving and Working with Data
        1. Windows PowerShell Providers
        2. Using the get-psdrive Cmdlet
        3. Using the set-location Cmdlet
        4. Using the get-childitem Cmdlet
        5. Using the get-location Cmdlet
        6. Using the get-content Cmdlet
        7. Using the measure-object Cmdlet
        8. The new-item Cmdlet
        9. The new-psdrive Cmdlet
        10. Summary
      10. Scripting with Windows PowerShell
        1. Enabling Scripts on Your Machine
        2. Using the set-variable and Related Cmdlets
        3. Summary
      11. Additional Windows PowerShell Language Constructs
        1. Arrays
        2. Associative Arrays
        3. Conditional Expressions
        4. Looping Constructs
        5. Summary
      12. Processing Text
        1. The .NET String Class
        2. Casting Strings to Other Classes
      13. COM Automation
        1. Using the new-object Cmdlet
        2. Working with Specific Applications
        3. Using Synthetic Types
        4. Summary
      14. Working with .NET
        1. Windows PowerShell and the .NET Framework
        2. Creating .NET Objects
        3. Inspecting Properties and Methods
        4. Using .NET Reflection
        5. Summary
    7. Putting Windows PowerShell to Work
      1. Using Windows PowerShell Tools for Discovery
        1. Exploring System State
        2. Exploring the Environment Variables
        3. Exploring the Current Application Domain
        4. Exploring Services
        5. Using the get-service Cmdlet
        6. Summary
      2. Security
        1. Minimizing the Default Risk
        2. The Certificate Namespace
        3. Signed Scripts
        4. Summary
      3. Working with Errors and Exceptions
        1. Errors in PowerShell
        2. $Error
        3. Using Error-Related variables
        4. Using the $ErrorActionPreference variable
        5. Trap Statement
        6. Using Common Parameters
        7. The write-error Cmdlet
        8. Summary
      4. Debugging
        1. Handling Syntax Errors
        2. The set-PSDebug Cmdlet
        3. The write-debug Cmdlet
        4. Tracing
        5. The trace-command Cmdlet
        6. The set-tracesource Cmdlet
        7. The get-tracesource Cmdlet
        8. Summary
      5. Working with the File System
        1. Path Names in Windows PowerShell
        2. Simple Tasks with Folders and Files
        3. Finding Hidden Files
        4. Tab Completion
        5. Redirection
        6. Creating Custom Drives
        7. Cmdlets for File Actions
        8. Using Cmdlets to Work with Paths
        9. Summary
      6. Working with the Registry
        1. Introduction to the Registry
        2. Exploring the Registry Using Windows PowerShell
        3. Changing the Registry
        4. Summary
      7. Working with Environment Variables
        1. Environment Variables Overview
        2. The Environment Command Shell Provider
        3. Exploring Environment Variables
        4. Modifying Environment Variables
        5. Summary
    8. Language Reference
      1. Working with Logs
        1. Event Log Basics
        2. The get-eventlog Cmdlet
        3. Summary
      2. Working with WMI
        1. Introducing Windows Management Instrumentation
        2. Using the get-wmiobject Cmdlet
        3. Exploring a Windows System
        4. Summary
    9. Index