Overview

This course is a fast paced introduction to PowerShell for experienced C# developers. The course concentrates on how PowerShell can be used to automate day to day developer tasks, as opposed to focusing on the needs of system administrators.

Outline

Introduction to PowerShell

  • The need for a scripting language in the .NET Platform
  • High level characteristics of the PowerShell language
  • Comparing PowerShell to Korn Scripting, Ruby and Python
  • Exploring PowerShell commands using the command prompt
  • Writing and debugging scripts using the PowerShell ISE

Working with PowerShell Commands

  • Understanding what a Cmdlet is
  • Getting help about the built-in Cmdlets
  • Sorting, filtering and iterating over output
  • Arranging Cmdlets into pipelines and redirecting output
  • Displaying the output of pipelines as CVS, XML and HTML
  • Running commands in parallel and as background jobs

Using the Standard PowerShell Commands

  • Navigating and modifying the filesystem
  • Working with items in the system event log
  • Finding and working with process objects
  • Sending and retrieving data from servers
  • Loading and executing code from assemblies
  • Interacting with the MSBuild automation tool

Programming with PowerShell

  • Declaring scalar variables, arrays and tables
  • Making choices and iterating externally via loops
  • Iterating internally using script blocks / lambdas
  • Loading and working with types in .NET libraries
  • Disregarding the return values from method calls
  • Handling errors and exceptions from Cmdlets and code
  • Declaring functions and filters in PowerShell
  • Packaging PowerShell scripts as modules for reuse

Advanced Tasks in PowerShell

  • Creating and using your own PowerShell commands
  • Declaring your own complex types in PowerShell scripts
  • Using PowerShell for prototyping and testing applications
  • Working with Windows Management Instrumentation (WMI)
  • Using Powershell on Linux

Requirements

Delegates should have several years .NET development experience (ideally in C#) and be familiar with the core concepts and terminology of .NET (IL, Assemblies, AppDomains, the GAC etc…).