Transcription of Mastering Windows PowerShell Scripting
1 Mastering Windows PowerShell ScriptingMaster the art of automating and managing your Windows environment using PowerShellBrenton BlawatPUBLISHING professional expertise distilledBIRMINGHAM - MUMBAIM astering Windows PowerShell ScriptingCopyright 2015 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or effort has been made in the preparation of this book to ensure the accuracy of the information presented.
2 However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this published: April 2015 Production reference.
3 1210415 Published by Packt Publishing Place35 Livery StreetBirmingham B3 2PB, BlawatReviewersTim AmicoChristophe CR MONT omas RestrepoAcquisition EditorMeeta RajaniContent Development EditorRohit SinghTechnical EditorTanvi BhattCopy EditorsHiral BhatSonia MathurVikrant PhadkeAlpha SinghProject CoordinatorMary AlexProofreadersSimran BhogalSafis EditingMaria GouldPaul HindleIndexerRekha NairProduction CoordinatorAlwin RoyCover WorkAlwin RoyForewordWe all appreciate a little simplicity when it enters our busy, complicated lives.
4 Technology is no different. In fact, that is what we expect from technology it should simplify our lives. But it doesn't always work that technology can introduce vexing problems we don't every version of Microsoft DOS and then Windows , Microsoft included separate command-line interface shells. The shell could automate some tasks, but not all of them. Some tasks had to be accomplished manually, which is antithetical nearly heretical to our understanding of technology's should have been simple, automated tasks became slow, frustrating, and manual chores.
5 That conundrum didn't go provided much-needed simplicity when it introduced PowerShell in 2006. Task automation and configuration management eliminated a great deal of time-consuming manual work. In short, PowerShell was a game has solved many of the command-line and Scripting issues that complicated our work. It introduced simplicity. It helped organizations become more agile, more productive, and save money. PowerShell is a powerful tool, and it has demonstrated its practical value many its utility, though, PowerShell remains a confusing tool to many IT administrators, and the need for greater clarity is through this lens that Mr.
6 Brenton Blawat provides an insightful new analysis of PowerShell a valuable guidebook for those who struggle to understand PowerShell . Others have offered narratives that attempt to explain PowerShell , but they rarely provide the roadmap, background, or context that administrators need to get from Point A to Point , this is the right time for a comprehensive new general terms, Mr. Blawat's book will help those who struggle to manage their compute environments. It includes important guidance on programming in PowerShell , starting with basic concepts and then introducing advanced Blawat deconstructs and demystifies this programming language, sharing his intimate knowledge in a format that demonstrates the clarity of thought and prose that a difficult subject requires.
7 Many authors have attempted this climb, but only Mr. Blawat has reached the summit. His examination provides relevant information for administrators who work with and sometimes struggle with PowerShell on a daily Mr. Blawat explains in the following pages, the rapid adoption of cloud-based technologies paralleled the never-ending need for additional computing power in data centers. This created the need to efficiently build and expand systems with extreme precision. In addition to provisioning the base systems, there was a need to dynamically customize these new systems to work in unison with current running drove the need for the next generation system automation languages that would provide full configuration for systems on the fly.
8 Not only do these automation languages greatly reduce time to use, but they also ensure that no mistakes are made during the configuration process. All systems are created is a .NET-based next generation automation language that provides both systems provisioning and management functionality for Windows -based systems. Leveraging command-line like interactions, PowerShell can be compiled into scripts that can systematically execute tasks on a system. Not limited to creating new systems, engineers are leveraging PowerShell to automate mundane tasks so that they can focus on other pressing activities in their has fully embraced PowerShell in its full software portfolio to offer full integration with its products.
9 Not only can you dynamically install the Microsoft software, but you can also fully manage the entire Microsoft software environment using PowerShell . PowerShell has also been embraced by third-party manufacturers through the integration of PowerShell modules. These modules provide full management capabilities for products such as network devices, storage subsystems, virtualization guests and hosts, security appliances, and other third-party many organizations, CDW has benefitted greatly from PowerShell , so this book hits very close to home for me.
10 We use PowerShell scripts to manage customer environments in managed services and the installation of management use Microsoft Orchestrator to provide back-end logic for simple user interfaces for help desk activities, like user-driven password resets and user-driven software installations. We also rely on Microsoft Orchestrator to automatically troubleshoot and remediate 's customers also benefit from PowerShell in myriad ways. We assist a wide variety of Fortune 500 clients to develop PowerShell automation scripts to build new systems and manage their environments, including health check scripts, systems discovery, and advanced regulatory security , PowerShell 's incredible utility has made it invaluable to CDW, our customers, and countless organizations across the globe.