Windows PowerShell 4.0 for .NET Developers

Windows PowerShell 4.0 for .NET Developers
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Enables developers to start adopting Windows PowerShell in their own application to extend its capabilities and manageability
  • Introduces beginners to the basics, progressing on to advanced level topics and techniques for professional PowerShell scripting and programming
  • Step-by-step guide, packed with real world scripts examples, screenshots, and best practices

Book Details

Language : English
Paperback : 140 pages [ 235mm x 191mm ]
Release Date : January 2014
ISBN : 1849688761
ISBN 13 : 9781849688765
Author(s) : Sherif Talaat
Topics and Technologies : All Books, Application Development, Enterprise

Table of Contents

Chapter 1: Getting Started with Windows PowerShell
Chapter 2: Unleashing Your Development Skills with PowerShell
Chapter 3: PowerShell for Your Daily Administration Tasks
Chapter 4: PowerShell and Web Technologies
Chapter 5: PowerShell and Team Foundation Server
  • Chapter 1: Getting Started with Windows PowerShell
    • Introducing Windows PowerShell
    • Windows PowerShell consoles
      • The Windows PowerShell console
      • The Integrated Scripting Environment (ISE)
    • The key features of Windows PowerShell
    • PowerShell fundamentals – back to basics
      • Working with objects
      • Understanding the piping and pipelines
      • Understanding and using aliases
      • Using variables and data types
      • Comparison and logical operators
      • Working with arrays and hash tables
      • Script flow and execution control
        • Conditional execution
        • Iterations statements
      • Using functions
      • Understanding providers and drives
      • Working with script files
      • Comments in PowerShell
      • Using help in Windows PowerShell
      • PowerShell's common parameters
    • Summary
  • Chapter 2: Unleashing Your Development Skills with PowerShell
    • Understanding CIM and WMI
      • CIM and WMI in Windows PowerShell
      • More reasons to adopt CIM
    • Working with XML
      • Loading XML files
        • Using the Get-Content cmdlet
        • Using the Select-Xml cmdlet
      • Importing and exporting XML files
    • Working with COM
      • Creating an instance of a COM object
      • Automating Internet Explorer with COM and PowerShell
      • Automating Microsoft Excel with COM and PowerShell
    • Working with .NET objects
      • Creating .NET objects
      • Extending .NET objects
      • Extending .NET framework types
        • Defining the object type using an inline C# class
        • Defining an object type using an assembly name or file
    • Understanding Windows PowerShell Modules
    • Creating Windows PowerShell Modules
      • The script modules
      • The binary modules
        • Creating your first binary module
      • The manifest modules
      • The dynamic modules
    • Script debugging and error handling
      • Working with breakpoints
      • Debugging your script
      • Error-handling techniques
        • The $Error and $LastExistCode variables
    • Building GUI with PowerShell
    • Summary
  • Chapter 3: PowerShell for Your Daily Administration Tasks
    • Windows PowerShell remoting
      • Four different ways of using remoting
        • Interactive remoting
        • Ad hoc remoting
        • Persistent session
        • Implicit remoting
    • Windows PowerShell Workflow (PSW)
      • Creating a workflow using PowerShell
      • Executing a PowerShell Workflow
        • Sequential execution
        • Parallel execution
        • InlineScript activity
      • Controlling the PowerShell workflow execution
        • Persistent workflows
    • Windows PowerShell in action
      • Working with Windows roles and features
        • Installing Windows roles and features
        • Uninstalling Windows roles and features
      • Managing local users and groups
        • Creating a new local user account
        • Modifying an existing local user account
        • Adding and removing a user account to and from a group
        • Listing all the existing users and groups
      • Managing web servers – IIS
        • Working with web application pools
        • Creating a new website
        • Creating a new virtual directory
        • Creating a new web application
        • Creating an FTP site
        • Creating and modifying an existing website binding
        • Backing up and restoring the web configuration
      • SQL Server and Windows PowerShell
        • Loading SQL Server PowerShell
        • Working with the SQL Server scripting
    • Summary
  • Chapter 4: PowerShell and Web Technologies
    • Web cmdlets in PowerShell
      • Working with web services
        • Example 1 – using the GeoIPService web service
        • Example 2 – using the Stock Quote web service
      • Working with web requests
        • Example 1 – downloading files from the Internet
      • Using REST APIs
        • Example 1 – finding YouTube videos using PowerShell
        • Example 2 – reading web feeds
      • Working with JSON
        • Example 1 – converting objects into the JSON format
        • Example 2 – converting objects from JSON to the PowerShell format
    • Summary
  • Chapter 5: PowerShell and Team Foundation Server
    • TFS Power Tools
    • Getting started with TFS PowerShell cmdlets
    • Working with TFS PowerShell cmdlets
      • Retrieving TFS information
      • Working with TFS items' information
      • Managing TFS workspace
      • Managing changesets, shelvesets, and pending changes
    • Summary

Sherif Talaat

Sherif Talaat  is a young Computer Science addict. He holds many technology certificates. Sherif is working in the ICT industry since 2005; he used to work on Microsoft's core infrastructure platforms and solutions, with more focus on IT process automation and scripting techniques.

Sherif is one of the early adopters of Windows PowerShell in the Middle East and Africa. He speaks about Windows PowerShell at technical events and user groups' gatherings. He is the founder of  Egypt PowerShell User Group ( and the author of the first and only Arabic PowerShell blog ( He has been awarded the Microsoft  Mo Valuable Professional ( MVP) for PowerShell five times in a row since 2009.

You may also catch him at and follow him on Twitter @SherifTalaat .

He is also the author of PowerShell 3.0: Advanced Administration Handbook, Packt Publishing.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 1 submitted: last submission 07 May 2014

Errata Type: Code Related | Page no: 53


PS C:\> Import-Module Import-Module "D:\MyBinaryModule\MyBinaryModule.dll"

Should be:

PS C:\> Import-Module "D:\MyBinaryModule\MyBinaryModule.dll"

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Windows PowerShell 4.0 for .NET Developers +    MediaWiki Administrators’ Tutorial Guide =
50% Off
the second eBook
Price for both: $22.50

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Explore the new features of Windows PowerShell 4.0
  • Understand PowerShell syntax and grammar such as pipeline, looping and working with objects
  • Discover how to extend PowerShell capabilities with .NET framework, XML, WMI, and COM+
  • Work with Windows Server, Users and Groups, IIS, and SQL Server
  • Automate ALM using Team Foundation Server and Windows PowerShell
  • Get to grips with Windows PowerShell and Internet technologies such as JSON, XML web services, and RESTful applications

In Detail

The world of technology is growing faster than ever, and the business needs are getting more complex every day. With PowerShell in your toolbox, you have an object-based scripting language, task-based shell, along with a powerful automation engine. PowerShell is built on top of .NET framework which gives an edge over the other tools when it comes to integration and automation of Microsoft product and technologies.

Packed with a set of real world scenarios and detailed scripts that will help you get started with PowerShell, this practical guide will help you to understand the syntax and grammar, build your scripts and modules, and integrate them with different technologies and tools. PowerShell is built on top of .NET framework, which gives an edge over other tools when it comes to integration and automation of Microsoft products and technologies.

Starting with the essentials of PowerShell along with the new features in PowerShell 4.0, this guide explores building scripts and modules, and takes an in-depth look at integration topics.

This book covers the use of PowerShell with .NET, WMI, and COM. It also covers the use of PowerShell to manage Windows Server, Internet Information Services, SQL Server, and Team Foundation Server. You will also learn to work with XML and RESTful web services.

This practical guide provides an easy and fast way to become a PowerShell expert via a collection of selected real world scenarios, detailed solutions, and screenshots.


A fast-paced guide, packed with easy-to-follow practical examples and real-world scenarios, along with detailed descriptions and screenshots.

Who this book is for

If you are a .NET developer who wants to learn how to use Windows PowerShell then this book is what you are looking for. This book takes you from the basics to a professional level in PowerShell scripting. In order to get the maximum benefit from this book, you need to have some basic scripting knowledge or at least hands-on experience with one of the .NET programming languages.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software