Recursively load and find all dependencies of default assemblies. This sacrifices some performance for determinism in how transitive dependencies will be shared between host and plugin. Fixes #41
25 lines
596 B
C#
25 lines
596 B
C#
using System;
|
|
using System.Management.Automation;
|
|
|
|
namespace PowerShellPlugin
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Console.WriteLine(GetGreeting());
|
|
}
|
|
|
|
public static string GetGreeting()
|
|
{
|
|
using (var ps = PowerShell.Create())
|
|
{
|
|
var type = typeof(AliasAttribute);
|
|
// Console.WriteLine(type.Assembly.Location);
|
|
var results = ps.AddScript("Write-Output hello").Invoke();
|
|
return results[0].ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|