contents
Foreword
Preface
Acknowledgments
About this book
Part 1 Learning PowerShell
- 1 Welcome to PowerShell
- 1.1 What is PowerShell?
- 1.2 Soul of a new language
- 1.3 Brushing up on objects
- 1.4 Dude! Where’s my code?
- 1.5 Summary
- 2 The basics
- 2.1 Command concepts and terminology
- 2.2 Parsing and PowerShell
- 2.3 Pipelines and commands
- 2.4 Formatting and output
- 2.5 Summary
- 3 Working with types
- 3.1 Type management in the wild, wild west
- 3.2 Basic types and literals
- 3.3 Type conversions
- 3.4 Summary
- 4 Operators and expressions
- 4.1 Arithmetic operators
- 4.2 The assignment operators
- 4.3 Comparison operators
- 4.4 The pattern matching operators
- 4.5 Logical and bitwise operators
- 4.6 Summary
- 5 Advanced operators and variables
- 5.1 Operators for working with types
- 5.2 The unary operators
- 5.3 Grouping, subexpressions, and array subexpressions
- 5.4 Array operators
- 5.5 Property and method operators
- 5.6 The PowerShell format operator -F
- 5.7 Redirection and the redirection operators
- 5.8 Variables
- 5.9 Summary
- 6 Flow control in scripts
- 6.1 Using the if/elseif/else statement
- 6.2 The while loop
- 6.3 The do/while loop
- 6.4 The for loop
- 6.5 The foreach loop
- 6.6 Labels, break, and continue
- 6.7 The PowerShell switch statement
- 6.8 Flow control using cmdlets
- 6.9 The value of statements
- 6.10 Summary
- 7 Functions and scripts
- 7.1 Function basics
- 7.2 Formal parameters and the param statement
- 7.3 Returning values from functions
- 7.4 Using functions in a pipeline
- 7.5 Managing functions
- 7.6 Scripts at long last
- 7.7 Summary
- 8 Scriptblocks and objects
- 8.1 Scriptblock basics
- 8.2 Building and manipulating objects
- 8.3 A closer look at the type-system plumbing
- 8.4 Extending the PowerShell language
- 8.5 Type extension
- 8.6 Building code at runtime
- 8.7 Summary
- 9 Errors, exceptions, and script debugging
- 9.1 Error handling
- 9.2 Dealing with errors that terminate execution
- 9.3 Script debugging
- 9.4 Nested prompts and breakpoints
- 9.5 Low-level tracing
- 9.6 The PowerShell event log
- 9.7 Summary
Part 2 Using PowerShell
- 10 Processing text, files, and XML
- 10.1 Processing unstructured text
- 10.2 File processing
- 10.3 XML processing
- 10.4 Summary
- 11 Getting fancy—.NET and WinForms
- 11.1 Using .NET from PowerShell
- 11.2 PowerShell and the Internet
- 11.3 PowerShell and graphical user interfaces
- 11.4 Summary
- 12 Windows objects: COM and WMI
- 12.1 Working with COM in PowerShell
- 12.2 Working with WMI in PowerShell
- 12.3 So which object model should I choose?
- 12.4 Summary
- 13 Security, security, security
- 13.1 Introduction to security
- 13.2 Security modeling
- 13.3 Securing the PowerShell environment
- 13.4 Signing scripts
- 13.5 Writing secure scripts
- 13.6 Summary
 
Comparing PowerShell to other languages
Admin examples
The PowerShell grammar
index