Windows Powershell in Action
暫譯: Windows PowerShell 實戰

Bruce G. Payette

  • 出版商: Manning
  • 出版日期: 2007-02-05
  • 售價: $1,740
  • 貴賓價: 9.5$1,653
  • 語言: 英文
  • 頁數: 576
  • 裝訂: Paperback
  • ISBN: 1932394907
  • ISBN-13: 9781932394900
  • 相關分類: Powershell
  • 已過版

買這商品的人也買了...

商品描述

Description

“The book on PowerShell, it has all the secrets.”
—James Truher, PowerShell Program Manager, 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.”
—Jeffrey Snover, from the Foreword

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#.

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.

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.

 

Table of 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! Wheres 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 1

商品描述(中文翻譯)

**書籍描述**

「這本關於 PowerShell 的書,擁有所有的秘密。」
—James Truher,PowerShell 程式經理,微軟公司

「Bruce 是一部行走的百科全書,涵蓋了所有好的、壞的、穩定的和古怪的語言理念……這是一本只有 Bruce 能寫的書。」
—Jeffrey Snover,前言中提到

Windows 擁有易於使用的介面,但如果你想要自動化它,生活可能會變得困難。也就是說,除非你使用 PowerShell,這是一種來自微軟的優雅新動態語言,設計為通用的 Windows 腳本工具。PowerShell 讓你能夠從命令行編寫管理任務的腳本並控制 Windows。因為它是專門為 Windows 開發的,程式設計師和高級用戶現在可以在 shell 中執行以前需要 VB、VBScript 或 C# 的操作。

《Windows PowerShell in Action》是由 Bruce Payette 撰寫的,他是 Windows PowerShell 團隊的創始成員之一,PowerShell 語言的共同設計者以及 PowerShell 語言實現的主要作者。從他那裡,你將深入了解這門語言及其最佳使用方式,並且你會喜歡他對 PowerShell 為何如此運作的見解。

這本書是針對系統管理員和開發人員的教程,介紹 PowerShell 語言及其環境。它展示了如何構建腳本和工具來自動化系統任務,或創建強大的系統管理工具,以處理 Windows 管理員日常生活中的任務。書中充滿了有趣的範例,將激發你的想像力。這本書涵蓋了批次腳本、字串處理、COM、WMI,甚至 .NET 和 WinForms 編程。

**目錄**

前言
序言
致謝
關於本書

**第一部分 學習 PowerShell**
1 歡迎來到 PowerShell
1.1 什麼是 PowerShell?
1.2 新語言的靈魂
1.3 物件的回顧
1.4 哥們!我的程式碼在哪裡?
1.5 總結
2 基礎知識
2.1 命令概念和術語
2.2 解析和 PowerShell
2.3 管道和命令
2.4 格式化和輸出
2.5 總結
3 與類型的互動
3.1 在狂野西部的類型管理
3.2 基本類型和字面量
3.3 類型轉換
3.4 總結
4 運算子和表達式
4.1 算術運算子
4.2 指派運算子
4.3 比較運算子
4.4 模式匹配運算子
4.5 邏輯和位元運算子
4.6 總結
5 進階運算子和變數
5.1 用於處理類型的運算子
5.2 一元運算子
5.3 分組、子表達式和陣列子表達式
5.4 陣列運算子
5.5 屬性和方法運算子
5.6 PowerShell 格式運算子 -F
5.7 重定向和重定向運算子
5.8 變數
5.9 總結
6 腳本中的流程控制
6.1 使用 if/elseif/else 語句
6.2 while 迴圈
6.3 do/while 迴圈
6.4 for 迴圈
6.5 foreach 迴圈
6.6 標籤、break 和 continue
6.7 PowerShell switch 語句
6.8 使用 cmdlet 的流程控制
6.9 語句的值
6.10 總結
7 函數和腳本
7.1 函數基礎
7.2 正式參數和 param 語句
7.3 從函數返回值
7.4 在管道中使用函數
7.5 管理函數
7.6 終於有腳本了
7.7 總結
8 腳本區塊和物件
8.1 腳本區塊基礎
8.2 構建和操作物件
8.3 更深入了解類型系統的內部運作
8.4 擴展 PowerShell 語言
8.5 類型擴展
8.6 在運行時構建代碼
8.7 總結
9 錯誤、例外和腳本調試
9.1 錯誤處理
9.2 處理終止執行的錯誤
9.3 腳本調試
9.4 嵌套提示和斷點
9.5 低級追蹤
9.6 PowerShell 事件日誌
9.7 總結

**第二部分 使用 PowerShell**
10 處理文本、文件和 XML
10.1 處理非結構化文本
10.2 文件處理
10.3 XML 處理
10.4 總結
11 想要花俏?.NET 和 WinForms
11.1 從 PowerShell 使用 .NET
11.2 PowerShell 和互聯網
11.3 PowerShell 和圖形用戶介面
11.4 總結
12 Windows 物件:COM 和 WMI
12.1 在 PowerShell 中使用 COM
12.2 在 PowerShell 中使用 WMI
12.3 那麼我應該選擇哪個物件模型?
12.4 總結
13 安全性、安全性、安全性
13.1 安全性介紹
13.2 安全性建模
13.3 確保 PowerShell 環境的安全
13.4 簽署腳本
13.5 編寫安全腳本
13.6 總結
比較 PowerShell 與其他語言
管理範例
PowerShell 語法
索引

最後瀏覽商品 (20)