Pash-Project/Pash — pull request #147 by mrward (2013-09-08 14:59:06+00:00)
Title: Initial session state - variables and modules

Make variables defined on the initial session state available to the runspace.
Make cmdlets available to the runspace for modules that are added to the initial session state.

So given the initial session state:

var initialSessionState = InitialSessionState.CreateDefault();
initialSessionState.ImportPSModule(new string[] { @"d:\path\to\cmdlets\MyCmdlet.dll" });
var variable = new SessionStateVariableEntry("DTE", dte, "SharpDevelop DTE object");
initialSessionState.Variables.Add(variable);

The Pash command line will now have all cmdlets from MyCmdlet.dll available and the $dte variable can also be used.