forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (37 loc) · 1.5 KB
/
Program.cs
File metadata and controls
39 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System;
using System.Management.Automation;
using System.Reflection;
namespace Microsoft.PowerShell
{
/// <summary>
/// Defines an entry point for the .NET CLI "powershell" app
/// </summary>
public sealed class ManagedPSEntry
{
/// <summary>
/// Starts the managed MSH
/// </summary>
/// <param name="args">
/// Command line arguments to the managed MSH
/// </param>
public static int Main(string[] args)
{
#if CORECLR
// PowerShell has to set the ALC here, since we don't own the native host
string appBase = System.IO.Path.GetDirectoryName(typeof(ManagedPSEntry).GetTypeInfo().Assembly.Location);
return (int)PowerShellAssemblyLoadContextInitializer.
InitializeAndCallEntryMethod(
appBase,
new AssemblyName("Microsoft.PowerShell.ConsoleHost, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),
"Microsoft.PowerShell.UnmanagedPSEntry",
"Start",
new object[] { string.Empty, args, args.Length });
#else
return UnmanagedPSEntry.Start(string.Empty, args, args.Length);
#endif
}
}
}