Book Image

Windows PowerShell for .NET Developers - Second Edition

By : Chendrayan Venkatesan, Sherif Talaat
Book Image

Windows PowerShell for .NET Developers - Second Edition

By: Chendrayan Venkatesan, Sherif Talaat

Overview of this book

Windows PowerShell 5.0 for .NET Developers is your self-start guide to performing automation using Windows PowerShell. This book will help you to understand the PowerShell syntax and grammar and will also teach you techniques to remove the rough edges of manual deployments. Packed with PowerShell scripts and sample C# codes to automate tasks, it also includes real-world scenarios such as administrating office servers to help you save time and perform deployments swiftly and efficiently. The book begins with the Windows PowerShell basics, explores the significant features of Windows Management Framework 5.0, covers the basic concepts of Desired State Configuration and the importance of idempotent deployments. By the end of the book, you will have a good understanding of Windows PowerShell’s features and will be able to automate your tasks and manage configuration effectively.
Table of Contents (13 chapters)

Preface

Windows PowerShell is no longer a secret in the world of IT. Starting in 2006, it's been growing and has now turned out to be a massive automation platform especially for Microsoft products and technologies.

Windows PowerShell 5.0 for .NET Developers is your self-start guide to performing automation using Windows PowerShell. This book will help you to understand the PowerShell syntax and grammar and will also teach you techniques to remove the rough edges of manual deployments. Packed with PowerShell scripts and sample C# codes to automate tasks, it also includes real-world scenarios, such as administrating office servers to help you save time and perform deployments swiftly and efficiently.

What this book covers

Chapter 1, Getting Started with Windows PowerShell, covers the basics of Windows PowerShell, the importance of object-based shells, and how ISE helps us in building scripts.

Chapter 2, Unleashing Development Skills Using Windows PowerShell 5.0, explores XML and COM automation and NET objects for Admin and Development tasks. You will also get acquainted with the PowerShell modules and how script debugging works.

Chapter 3, Exploring Desired State Configuration, gets you started with Desired State Configuration (DSC) concepts such as installing WMF 5.0 April 2015 Preview, Imperative versus declarative programming and their significant features. It also explores Windows Remote Management and CIM, and teaches you to create configurations scripts.

Chapter 4, PowerShell and Web Technologies, starts with the installation and configuration of Web Access, and explores Web requests, services, and REST API.

Chapter 5, Exploring Application Programming Interface, covers the key benefits of the API and using it in Windows PowerShell, Exchange Web Services, LYNC Client-side API, and SharePoint Client Side Object Model; you'll walk through a demo to create a PowerShell module in C# for office servers.

What you need for this book

The following is a list of software required and supported operating systems for this book:

  • Windows Management Framework 3.0 and advanced (Windows 7)

  • Windows Management Framework 5.0 (Windows 7, Windows Server 2008 R2 SP1 and advanced)

  • Windows Management Framework 5.0 (Windows 7, Windows Server 2012 R2)

Who this book is for

If you are an IT professional or developer who has worked on the .NET platform and you want to learn about automation using Windows PowerShell, then this book is for you. This self-start guide takes you from the basics and gradually moves to an intermediate level to show you how to perform professional scripting.

Conventions

In this book, you will find a number of text styles that distinguishe between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "$MaximumHistoryCount is a built-in variable that returns the actual value of the command's history."

Any command-line input or output is written as follows:

(Get-Host).UI.RawUI
(Get-Host).UI.RawUI | GM

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: " Using the Options tab, we can see Cursor Size, Command History, and Edit Options, and adjust them as we require."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/7435EN_ColouredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.