Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,8 @@ protected override void ProcessRecord()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iSazonov, your last commit had 1 failures in PowerShell-CI-macos
Test-Connection.TraceRoute.TraceRoute works

Expected exactly '10.79.9.114', but got 127.0.0.1.
at <ScriptBlock>, /Users/runner/runners/2.164.8/work/1/s/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1: line 257
257:             $result[0].TargetAddress | Should -BeExactly $realAddress

}

#if !CORECLR
PSEtwLog.LogSettingsEvent(MshLog.GetLogContext(Context, MyInvocation),
EtwLoggingStrings.ExecutionPolicyName, executionPolicy, null);
#endif
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/System.Management.Automation/engine/parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Management.Automation.Runspaces;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
#if !CORECLR
using Microsoft.CodeAnalysis;
#endif

namespace System.Management.Automation.Language
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ internal static ConfigurationDataFromXML Create(string initializationParameters)
readerSettings.IgnoreProcessingInstructions = true;
readerSettings.MaxCharactersInDocument = 10000;
readerSettings.ConformanceLevel = ConformanceLevel.Fragment;
#if !CORECLR // No XmlReaderSettings.XmlResolver in CoreCLR
readerSettings.XmlResolver = null;
#endif

using (XmlReader reader = XmlReader.Create(new StringReader(initializationParameters), readerSettings))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,27 +435,7 @@ public static int InitPlugin(
{
return WSManPluginConstants.ExitCodeFailure;
}
#if !CORECLR
// For long-path support, Full .NET requires some AppContext switches;
// (for CoreCLR this is Not needed, because CoreCLR supports long paths by default)
// internally in .NET they are cached once retrieved and are typically hit very early during an application run;
// so per .NET team's recommendation, we are setting them as soon as we enter managed code.
// We build against CLR4.5 so we can run on Win7/Win8, but we want to use apis added to CLR 4.6, so we use reflection
try
{
Type appContextType = Type.GetType("System.AppContext"); // type is in mscorlib, so it is sufficient to supply the type name qualified by its namespace

object[] blockLongPathsSwitch = new object[] { "Switch.System.IO.BlockLongPaths", false };
object[] useLegacyPathHandlingSwitch = new object[] { "Switch.System.IO.UseLegacyPathHandling", false };

appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, blockLongPathsSwitch, CultureInfo.InvariantCulture);
appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, useLegacyPathHandlingSwitch, CultureInfo.InvariantCulture);
}
catch (Exception)
{
// If there are any non-critical exceptions (e.g. we are running on CLR prior to 4.6.2), we won't be able to use long paths
}
#endif
Marshal.StructureToPtr<WSManPluginEntryDelegates.WSManPluginEntryDelegatesInternal>(workerPtrs.UnmanagedStruct, wkrPtrs, false);
return WSManPluginConstants.ExitCodeSuccess;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,12 +823,8 @@ internal void ValidatePathProvider(PathInfo path)
/// <param name="message">Message to log.</param>
internal void LogMessage(string message)
{
#if !CORECLR // TODO:CORECLR Uncomment when we add PSEtwLog support
List<string> details = new List<string>();

details.Add(message);
List<string> details = new List<string>() { message };
PSEtwLog.LogPipelineExecutionDetailEvent(MshLog.GetLogContext(Context, Context.CurrentCommandProcessor.Command.MyInvocation), details);
#endif
}

#endregion
Expand Down