mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
initial version of custom hosting code
This commit is contained in:
@@ -2,4 +2,5 @@ using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
[assembly:InternalsVisibleTo("System.Management.Automation")]
|
||||
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly:AssemblyVersion("1.0.0.0")]
|
||||
|
||||
|
||||
@@ -2,3 +2,4 @@ using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
[assembly:InternalsVisibleTo("System.Management.Automation")]
|
||||
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly:AssemblyVersion("1.0.0.0")]
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Reflection;
|
||||
[assembly:InternalsVisibleTo("Microsoft.PowerShell.CoreCLR.AssemblyLoadContext")]
|
||||
[assembly:InternalsVisibleTo("ps_test")]
|
||||
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly:AssemblyVersion("1.0.0.0")]
|
||||
|
||||
|
||||
//
|
||||
|
||||
+1
-1
Submodule src/monad-native updated: a756ecaadf...f7396c9561
@@ -0,0 +1,4 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly:AssemblyVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,4 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly:AssemblyVersion("1.0.0.0")]
|
||||
@@ -8,6 +8,7 @@ using System.Management.Automation.Runspaces;
|
||||
using System.Management.Automation.Host;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ps_hello_world
|
||||
{
|
||||
@@ -456,8 +457,11 @@ namespace ps_hello_world
|
||||
|
||||
public static void init()
|
||||
{
|
||||
string psBasePath = System.IO.Directory.GetCurrentDirectory();
|
||||
PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(psBasePath);
|
||||
//string psBasePath = System.IO.Directory.GetCurrentDirectory();
|
||||
//PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(psBasePath);
|
||||
|
||||
//Assembly a = Assembly.Load(new AssemblyName("System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));
|
||||
//Console.WriteLine("##########################\nloaded assembly a=" + a + " during init\n#########################");
|
||||
|
||||
// PH: this debugging requires a change in the core PS stuff that was stashed away
|
||||
// during source cleanup
|
||||
@@ -520,6 +524,19 @@ namespace ps_hello_world
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnmanagedMain(int argc, [MarshalAs(UnmanagedType.LPArray,ArraySubType=UnmanagedType.LPStr,SizeParamIndex=0)] String[] argv)
|
||||
{
|
||||
init();
|
||||
List<String> allArgs = new List<String>();
|
||||
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
allArgs.Add(argv[i]);
|
||||
}
|
||||
|
||||
test2(allArgs.ToArray());
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// important:
|
||||
Reference in New Issue
Block a user