Book description
Second edition of this book is available
Windows PowerShell in Action was written by Bruce Payette, one of the founding members of the Windows PowerShell team, co-designer of the PowerShell language and the principal author of the PowerShell language implementation. From him you will gain a deep understanding of the language and how best to use it, and you'll love his insights into why PowerShell works the way it does.
About the Technology
Windows has an easy-to-use interface, but if you want to automate it, life can get hard. That is, unless you use PowerShell, an elegant new dynamic language from Microsoft designed as an all-purpose Windows scripting tool. PowerShell lets you script administrative tasks and control Windows from the command line. Because it was specifically developed for Windows, programmers and power-users can now do things in a shell that previously required VB, VBScript, or C#.
About the Book
This book is a tutorial for sysadmins and developers introducing the PowerShell language and its environment. It shows you how to build scripts and utilities to automate system tasks or create powerful system management tools to handle the day-to-day tasks that drive a Windows administrator's life. It's rich in interesting examples that will spark your imagination. The book covers batch scripting and string processing, COM, WMI, and even .NET and WinForms programming.
What's Inside
- Master the PowerShell language
- Secure scripting with PowerShell
- How to process strings, files, and XML
- Techniques for network and GUI programming
- Script Windows applications like Excel
- Author feedback at manning.com/payette
About the Reader
About the Author
Bruce Payette is a founding member of the PowerShell team at Microsoft. He is a co-designer of the PowerShell language and the principal author of the language implementation. Prior to joining Microsoft, he worked at Softway Systems and MKS, building UNIX tools for Windows.
Quotes
THE book on PowerShell, it has ALL the secrets.
- FROM THE FOREWORD by James Truher, Microsoft Corporation
Bruce is a walking encyclopedia of every good, bad, solid, and wacky language idea that has been tried... This is a book that only Bruce could have written.
- FROM THE FOREWORD by Jeffrey Snover, Windows PowerShell Architect
If all it had going for it was the authoratative pedigree of the writer, it might be worth it, but it's also well-written, well-organized, and thorough, which I think makes it invaluable as both a learning tool and a reference.
- Jeff Copeland, Slashdot.org
[It gives you] inside information, excellent examples, and a colorful writing style.
- Marc van Orsouw (MOW), www.thepowershellguy.com
The nuances of PowerShell from the lead language designer himself! Excellent content and easy readability!
- Keith Hill, Software Architect
I love this book!
- Scott Hanselman, ComputerZen.com
There's no better way to learn PowerShell than from someone on the core PowerShell team - and that's exactly what you get with this book.
- Joe Topjian, adminspotting.net
Publisher resources
Table of contents
- Copyright
- Foreword
- Preface
- Acknowledgments
- About this Book
-
1. Learning PowerShell
- 1. Welcome to PowerShell
- 2. The basics
- 3. Working with types
- 4. Operators and expressions
- 5. Advanced operators and variables
- 6. Flow control in scripts
- 7. Functions and scripts
- 8. Scriptblocks and objects
- 9. Errors, exceptions, and script debugging
-
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.2.1. Exploring WMI—what is it, and why do you care?
- 12.2.2. The Get-WmiObject cmdlet
- 12.2.3. The WMI object adapter
- 12.2.4. WMI shootout—VBScript versus PowerShell
- 12.2.5. The WMI type shortcuts
- 12.2.6. Working with WMI methods
- 12.2.7. Working with WMI events
- 12.2.8. Putting modified WMI objects back
- 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
-
10. Processing text, files, and XML
-
A. Comparing PowerShell to other languages
-
A.1. PowerShell and CMD.EXE
- A.1.1. Basic navigation and file operations
- A.1.2. Variables and substitution
- A.1.3. Running commands
- A.1.4. Differences in syntax
- A.1.5. Searching text: findstr and Select-String
- A.1.6. For loop equivalents
- A.1.7. Batch files and subroutines
- A.1.8. Setting the prompt
- A.1.9. Using doskey in PowerShell
- A.1.10. Using cmd.exe from PowerShell
-
A.2. PowerShell and UNIX shells
- A.2.1. Example: Stopping all processes
- A.2.2. Example: Stopping a filtered list of processes
- A.2.3. Example: Calculating the size of a directory
- A.2.4. Example: Working with dynamic values
- A.2.5. Example: Monitoring the life of a process
- A.2.6. Example: Checking for prerelease binaries
- A.2.7. Example: Uppercasing a string
- A.2.8. Example: Inserting text into a string
- A.3. PowerShell and Perl
- A.4. PowerShell and C#
- A.5. PowerShell and VBScript
-
A.1. PowerShell and CMD.EXE
-
B. Admin examples
- B.1. Getting active directory domain information
- B.2. Listing installed software features
- B.3. Retrieving terminal server properties
- B.4. List hot fixes installed on a machine
- B.5. Finding machines missing a hot fix
- B.6. Working with the event log
- B.7. Working with existing utility commands
- B.8. Working with Active Directory and ADSI
- B.9. Joining two sets of data
-
C. The PowerShell grammar
- C.1. Statement list
-
C.2. Statement
- C.2.1. Pipeline
- C.2.2. The if statement
- C.2.3. The switch statement
- C.2.4. The foreach statement
- C.2.5. The for and while statements
- C.2.6. The do/while and do/until statements
- C.2.7. The trap statement
- C.2.8. The finally statement
- C.2.9. Flow control statements
- C.2.10. Function declarations
- C.2.11. Parameter declarations
- C.3. Expression
- C.4. Value
- C.5. Tokenizer rules
Product information
- Title: Windows PowerShell in Action
- Author(s):
- Release date: February 2007
- Publisher(s): Manning Publications
- ISBN: 9781932394900
You might also like
book
Windows PowerShell for Developers
Want to perform programming tasks better, faster, simpler, and make them repeatable? Take a deep dive …
book
Windows PowerShell in Action, Second Edition
Windows Powershell in Action, Second Edition is a completely revised edition of the bestselling book on …
book
Pro PowerShell Desired State Configuration: An In-Depth Guide to Windows PowerShell DSC
Use Windows PowerShell Desired State Configuration (DSC) to configure your infrastructure on-premises and in the cloud. …
book
PowerShell and WMI
PowerShell and WMI is an example-driven guide for administrators managing networks of Windows servers and desktops. …