Skip to content

Commit

Permalink
Update files from Source Depot changeset [SD:709766]
Browse files Browse the repository at this point in the history
Corresponds to 15b1623435d6a195d1e877ba5c43709d991f573a in psl-monad.
  • Loading branch information
PowerShellTeam authored and andyleejordan committed May 31, 2016
1 parent 9fbb63c commit b38773e
Show file tree
Hide file tree
Showing 63 changed files with 1,012 additions and 423 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,6 @@ public string Status
/// <summary>
///
/// </summary>
[ArchitectureSensitive]
protected override void ProcessRecord()
{

Expand Down Expand Up @@ -2065,7 +2064,6 @@ public string[] DependsOn
/// <summary>
/// Create the service
/// </summary>
[ArchitectureSensitive]
protected override void BeginProcessing()
{
Diagnostics.Assert(!String.IsNullOrEmpty(Name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,6 @@ public String[] ReferencedAssemblies
internal bool referencedAssembliesSpecified = false;
internal string[] referencedAssemblies = Utils.EmptyArray<string>();

/// <summary>
/// Resolve referenced assembly from name or path to a platform specific form.
/// </summary>
/// <param name="referencedAssembly"></param>
/// <returns></returns>
internal abstract string ResolveReferencedAssembly(string referencedAssembly);

/// <summary>
/// The path to the output assembly
/// </summary>
Expand Down Expand Up @@ -998,7 +991,14 @@ private void LoadAssemblies(IEnumerable<string> assemblies)
{
foreach (string assemblyName in assemblies)
{
Assembly assembly = LoadFrom(ResolveReferencedAssembly(assemblyName));
// CoreCLR doesn't allow re-load TPA assemblis with different API (i.e. we load them by name and now want to load by path).
// LoadAssemblyHelper helps us avoid re-loading them, if they already loaded.
Assembly assembly = LoadAssemblyHelper(assemblyName);
if (assembly == null)
{
assembly = LoadFrom(ResolveReferencedAssembly(assemblyName));
}

if (passThru)
{
WriteTypes(assembly);
Expand Down Expand Up @@ -1072,7 +1072,7 @@ private void CheckTypesForDuplicates(Assembly assembly)

private bool InMemory { get { return String.IsNullOrEmpty(outputAssembly); } }

internal override string ResolveReferencedAssembly(string referencedAssembly)
private string ResolveReferencedAssembly(string referencedAssembly)
{
// if it's a path, resolve it
if (referencedAssembly.Contains(System.IO.Path.DirectorySeparatorChar) || referencedAssembly.Contains(System.IO.Path.AltDirectorySeparatorChar))
Expand Down Expand Up @@ -1143,6 +1143,9 @@ private Assembly LoadAssemblyHelper(string assemblyName)
// Generates a FileNotFoundException if you can't load the strong type.
// So we'll try from the short name.
catch (System.IO.FileNotFoundException) { }
// File load exception can happen, when we trying to load from the incorrect assembly name
// or file corrupted.
catch (System.IO.FileLoadException) { }

if (loadedAssembly != null)
return loadedAssembly;
Expand Down Expand Up @@ -1339,7 +1342,7 @@ internal override void PostSetLanguage(Language language)
// Internal mapping table from the shortcut name to the strong name
private static readonly Lazy<ConcurrentDictionary<string, string>> StrongNames = new Lazy<ConcurrentDictionary<string, string>>(InitializeStrongNameDictionary);

internal override string ResolveReferencedAssembly(string referencedAssembly)
private string ResolveReferencedAssembly(string referencedAssembly)
{
if (!String.Equals(System.IO.Path.GetExtension(referencedAssembly), ".dll", StringComparison.OrdinalIgnoreCase))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public DisplayHintType DisplayHint
/// <summary>
/// set the date
/// </summary>
[ArchitectureSensitive]
protected override void ProcessRecord()
{
DateTime dateToUse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ private uint Run(CommandLineParameterParser cpp, bool isPrestartWarned)
inputFormat = cpp.InputFormat;
wasInitialCommandEncoded = cpp.WasInitialCommandEncoded;

ui.ReadFromStdin = cpp.ExplicitReadCommandsFromStdin || Console.IsInputRedirected;
ui.ReadFromStdin = cpp.ExplicitReadCommandsFromStdin || (Console.IsInputRedirected && !cpp.NonInteractive);
ui.NoPrompt = cpp.NoPrompt;
ui.ThrowOnReadAndPrompt = cpp.ThrowOnReadAndPrompt;
noExit = cpp.NoExit;
Expand Down
52 changes: 20 additions & 32 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,28 @@ namespace Microsoft.PowerShell
public static
class ConsoleShell
{
/// <summary>
/// Entry point in to ConsoleShell. This method is called by
/// main of minishell.
/// </summary>
/// <param name="configuration">
/// Configuration information which is used to create Runspace.
/// </param>
///
/// <param name="bannerText">
/// Banner text to be displayed by ConsoleHost
/// </param>
///
/// <param name="helpText">
/// Help text for minishell. This is displayed on 'minishell -?'.
/// </param>
///
/// <param name="args">
/// Commandline parameters specified by user.
/// </param>
///
/// <returns>
/// An integer value which should be used as exit code for the
/// process.
/// </returns>
///
public static
int
Start(RunspaceConfiguration configuration,
string bannerText,
string helpText,
string[] args)
#if CORECLR
/// <summary>Entry point in to ConsoleShell. This method is called by main of minishell.</summary>
/// <param name="bannerText">Banner text to be displayed by ConsoleHost</param>
/// <param name="helpText">Help text for minishell. This is displayed on 'minishell -?'.</param>
/// <param name="args">Commandline parameters specified by user.</param>
/// <returns>An integer value which should be used as exit code for the process.</returns>
public static int Start(string bannerText, string helpText, string[] args)
{
return Start(null, bannerText, helpText, null, args);
}
#else
/// <summary>Entry point in to ConsoleShell. This method is called by main of minishell.</summary>
/// <param name="configuration">Configuration information which is used to create Runspace.</param>
/// <param name="bannerText">Banner text to be displayed by ConsoleHost</param>
/// <param name="helpText">Help text for minishell. This is displayed on 'minishell -?'.</param>
/// <param name="args">Commandline parameters specified by user.</param>
/// <returns>An integer value which should be used as exit code for the process.</returns>
public static int Start(RunspaceConfiguration configuration, string bannerText, string helpText, string[] args)
{
return Start(configuration, bannerText, helpText, null, args);
}
#endif

/// <summary>
///
Expand Down Expand Up @@ -82,7 +70,7 @@ public static
/// An integer value which should be used as exit code for the
/// process.
/// </returns>

internal static
int
Start(RunspaceConfiguration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3843,7 +3843,6 @@ internal static class Crypt32Helpers
/// <summary>
/// get a list of store names at the specified location
/// </summary>
[ArchitectureSensitive]
internal static List<string> GetStoreNamesAtLocation(StoreLocation location)
{
Security.NativeMethods.CertStoreFlags locationFlag =
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.PowerShell.Security/security/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ internal static SecureString PromptForSecureString(PSHostUserInterface hostUI,
///
/// <remarks> </remarks>
///
[ArchitectureSensitive]
internal static string GetStringFromSecureString(SecureString ss)
{
IntPtr p = Marshal.SecureStringToGlobalAllocUnicode(ss);
Expand Down
Binary file not shown.
Binary file modified src/Modules/PSGet/PSGet.Resource.psd1
Binary file not shown.
Loading

0 comments on commit b38773e

Please sign in to comment.