Hosting Windows PowerShell in your application
You can create an application that hosts Windows PowerShell. The host application can define the runspace where commands run, open sessions on a local or remote computer, and invoke the commands either synchronously or asynchronously based on the needs of the application.
07 Feb 2014
PaaP: Windows PowerShell as a Platform – Part 1 - Windows PowerShell Blog
A blog post by the Windows PowerShell team that provides a complete guide to getting started hosting Windows PowerShell in an application. The post provides instructions and code examples of creating a PowerShell object, adding commands and parameters, and invoking commands.
PaaP: Windows PowerShell as a Platform – Part 2 - Windows PowerShell Blog
The second part of a two-part blog post on hosting Windows PowerShell. This post covers how to create a host application that exposes only a limited set of commands by creating a custom runspace.
Writing a Windows PowerShell Host Application
MSDN documentation on writing a host application.
Host Sample 01
A simple sample from the Windows PowerShell team in the MSDN Code Gallery. This is a very simple implementation of a host application that calls a script that exits Windows PowerShell.
MSDN Code Gallery
Host Sample 06
This is a more robust example from Windows PowerShell team in the MSDN Code Gallery. This example creates an interactive console that allows users to run cmdlets and see the output.
MSDN Code Gallery
How To: Host the PowerShell Runtime
A blog post that discusses an overview of hosting Windows PowerShell, and provides a downloadable sample.
Mitch Denny's bog
Windows PowerShell Host Quckstart
A walkthrough of code examples to get you started hosting Windows PowerShell in your managed applications.