Windows PowerShell入门教程:实例解析

需积分: 10 39 下载量 158 浏览量 更新于2024-11-05 收藏 2.2MB PDF 举报
"Window Powershell 是微软推出的一种强大的命令行脚本环境,旨在提升系统管理员和开发人员在Windows操作系统上的工作效率。它结合了命令行工具和脚本语言,提供了更高级别的自动化能力。本书旨在为那些没有脚本背景知识的人提供一个对Windows PowerShell的入门介绍,通过实践例子帮助读者快速上手。尽管不是针对专业脚本编写者,但书中包含的信息对于新手来说足够入门,并激发他们深入探索脚本世界的兴趣。" 在Windows PowerShell中,你可以期待的功能和改进包括: 1. **对象导向的管道**:与传统的命令行工具不同,PowerShell的管道传递的是对象而不是纯文本,使得数据处理和分析更为高效。 2. **丰富的命令集(Cmdlets)**:PowerShell内置了一组以动词-名词形式命名的Cmdlets,如`Get-Process`、`Start-Service`等,这些Cmdlets设计成可组合使用,便于执行复杂的任务。 3. **强大的脚本语言**:PowerShell基于.NET Framework,因此可以直接使用.NET类库,编写脚本时可以利用.NET的强大功能。 4. **模块化设计**:模块化使得PowerShell能够管理和重用代码,方便用户创建自己的工具集。 5. **易学易用**:PowerShell提供了交互式的提示环境,可以通过尝试和错误快速学习,同时其语法简洁明了,易于理解。 6. **自动化任务管理**:对于系统管理员而言,PowerShell可以用来自动化重复性的系统管理任务,如批量修改配置、监控系统状态等。 7. **远程管理**:通过PowerShell Remoting,用户可以远程管理多台计算机,实现跨设备的自动化。 8. **集成开发环境(ISE)**:PowerShell ISE是一个内置的开发工具,支持调试、语法高亮和多文档编辑,为脚本编写提供便利。 9. **兼容性**:PowerShell兼容传统的DOS命令,使得用户可以在新环境中使用熟悉的命令。 通过本书,读者将了解到如何使用PowerShell的基本命令,如何编写简单的脚本,以及如何利用PowerShell进行系统管理和任务自动化。此外,书中可能会提及如何利用Help系统和在线资源进一步学习和解决问题。虽然不深度探讨高级话题,但对于初学者来说,这本书提供了一个良好的起点,引导他们踏入PowerShell的世界,逐渐掌握这个强大的工具。
2012-10-26 上传
Preface 1 Chapter 1: PowerShell Scripting Methods and Creating Custom Commands 7 Introduction 7 Setting up your Virtual Machine and running a test script 8 Authoring, debugging, and executing script accessing farm settings with PowerGUI and PowerShell ISE 10 Accessing advanced SharePoint 2010 functionality with external libraries 17 Creating a custom PowerShell command (CmdLet) 22 Creating a custom PowerShell Snap-In 26 Chapter 2: Enterprise Content Deployment and Provisioning Using PowerShell 33 Introduction 33 Provisioning site hierarchy during solution deployment 34 Installing features on the site and managing existing site features 39 Creating permission levels and security groups that use them 46 Managing site templates and their availability on sites 50 Associating features to existing site templates 55 Managing SharePoint workflow association using PowerShell 60 Configuring site themes and user interface artifacts 65 Chapter 3: Performing Advanced List and Content Operations in SharePoint using PowerShell 73 Introduction 73 Creating lists of custom structures 74 Setting SharePoint list item validation with PowerShell 78 Setting list item security 84 ii Table of Contents Setting list relationships 89 Customizing list views 94 Managing the use of content types in lists 99 Chapter 4: Managing External Data in SharePoint and Business Connectivity Services using PowerShell 105 Introduction 105 Importing a custom BCS model to SharePoint 106 Exporting SharePoint BCS model and schema 111 Creating instances of external lists with PowerShell 116 Managing permissions on an external list 121 Throttling items returned with external lists 127 Chapter 5: Managing SharePoint 2010 Metadata and Social Features Using PowerShell 133 Introduction 133 Creating new user profiles 134 Adding and configuring new profile properties 140 Bulk provisioning data into user profile properties 145 Creating, importing, and exporting managed metadata taxonomy terms 151 Enabling social ratings on lists and libraries 157 Bulk tagging content and deleting tags in SharePoint 162 Chapter 6: Managing SharePoint Search and FAST Search with PowerShell 169 Introduction 169 Configuring search query suggestions in your search center 170 Configuring search best bets 175 Configuring visual best bets 180 Configuring search audience targeting 186 Configuring search web parts automatically with PowerShell 191 Chapter 7: Managing SharePoint Site Content in Bulk using PowerShell 199 Introduction 199 Creating basic and complex content types 200 Creating and configuring document sets 205 Creating and editing publishing pages with PowerShell 211 Provisioning web parts in bulk on to SharePoint pages 217 Configuring web parts in bulk with PowerShell 222 Provisioning list rollups using Powershell 227 Chapter 8: Managing Documents and Records in SharePoint with PowerShell 233 iii Table of Contents Introduction 233 Provisioning documents and records center with PowerShell 234 Configuring record routing 240 Configuring a common record expiration policy 246 Creating a custom expiration policy for the record 252 Configuring content hub for content types used in records center 257 Chapter 9: Administrating Web Application and Server Administration in SharePoint with PowerShell 263 Introduction 263 Configuring web application settings 264 Parsing SharePoint logs using PowerShell 271 Managing web application throttling settings 276 Configuring sandbox solution policies 282 Managing sandbox solutions in SharePoint site collections 286