Book Image

Windows PowerShell for .NET Developers - Second Edition - Second Edition

Book Image

Windows PowerShell for .NET Developers - Second Edition - Second Edition

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)

Foreword

There is no doubt that Windows PowerShell is a great tool that you must have in your toolbox, whether you are a developer or an IT Pro. Windows PowerShell is not just another scripting language, but a complete management and automation platform with endless possibilities.

For a very long time, there has been a myth about scripting languages and who should use them. This myth states that automation tools, such as scripting tools and automation languages, are meant to be used by IT Pros. I think the reason for this misconception about scripting and automation is the limited functionalities and capabilities of those tools back then. However, this is no longer the case with PowerShell. For instance, Windows PowerShell is the first object-based scripting language because it is built on top of the .NET framework, which makes it easy to access all the powerful libraries underneath. Also, out of the box, it easily works with XML, ADSI, WMI, COM, and so on.

Today, for developers, Windows PowerShell is a core component of development tools such as Visual Studio and Team Foundation Server. You can use PowerShell to build your own automated test cases, provision and deploy applications, extend your software by building a PowerShell automation and management interface, and more interesting stuff that will be discussed in this book.

As the author of the first edition of this title, I was asked to write the second edition too. However, due to the fact the I was busy with another writing project I had to nominate someone to write it. Honestly, I couldn't think of anyone but Chendrayan Venkatesan (also known as Chen V), not only because he is a fellow MVP but also because of his enthusiasm and passion for PowerShell that allow him to always come up with great ideas and unique ways to do impressive things (you will find some of it in this book) with PowerShell.

Windows PowerShell for .NET developers is the jump-start reference for any developer looking for a consolidated resource to learn about Windows PowerShell. It is a fast-paced guide with short, crisp, and to the point real-world examples. This book takes you through a learning journey that starts with an overview of Windows PowerShell capabilities, components, and architecture. Then it walks you through the PowerShell syntax (which is pretty close to C#), working with objects, how to write scripts, functions, workflows, and so on.

Then you will learn how to use your .NET development experience to benefit from PowerShell. The book will show you how to work and manipulate .NET objects, COM, XML, WMI, CMI, and so on. After that, you will be introduced to PowerShell Desired State Configuration (DSC) and how to use it. DSC is a very useful component when it comes to standardizing your environments, which is important when you are deploying an application or even building a development and test environment that has to be identical to the production one.

Next the journey gets more interesting with cool stuff about using Windows PowerShell with the web technologies such as RESTful Web services, OData, and so many more. And finally, you will explore PowerShell API and SDK.

I am sure that you will enjoy the time you spend reading this book and learning these cool things brought to you by the one-and-only Chen V.

Ladies and gentlemen, get ready. The fun is about to start.

Sherif Talaat

PowerShell MVP