protected GetPowerShellRunspace ( string location ) : IRunspace | ||
location | string | |
return | IRunspace |
protected IRunspace GetPowerShellRunspace(string location)
{
if (this.runspace.IsNull())
{
// string loc = typeof(GetAzureHDInsightClusterCmdlet).Assembly.Location;
this.runspace = Help.SafeCreate(() => RunspaceAbstraction.Create());
this.runspace.NewPipeline().AddCommand("Import-Module").WithParameter("Name", location).Invoke();
}
return this.runspace;
}