Book Image

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

By : Chendrayan Venkatesan, Talaat
Book Image

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

By: Chendrayan Venkatesan, 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 (7 chapters)

Basics of WMI and CIM

WMI—Windows Management Instrumentation—is the Microsoft implementation of WBEM—Web Based Enterprise Management—which allows us to access management information from any environment. PowerShell makes access to WMI easy and consistently deliverable using an object-based technique.

Let's explore a few PowerShell cmdlets of WMI.

WMI is a part of the Microsoft.PowerShell.Management module. You can run the following command to explore the WMI cmdlets:

Get-Command -Module Microsoft.PowerShell.Management -Name '*WMI*'

The output is illustrated in the following image:

Basics of WMI and CIM

There are many tools available to explore all the WMI classes available in the WMI repository. You can use the following links to do so:

https://wmie.codeplex.com/

https://www.sapien.com/software/wmiexplorer

Using these tools, we can explore and view the classes, instances, properties, and qualifiers easily. It's a GUI tool, so it makes our job easy as well. As we...