Skip to content

Commit 2639cd8

Browse files
SteveL-MSFTdaxian-dbw
authored andcommitted
Autocorrected CRLF to LF (PowerShell#4943)
Also, fix `Parser.Tests.ps1` after correcting CRLF.
1 parent 8fdd68f commit 2639cd8

File tree

86 files changed

+13288
-13288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+13288
-13288
lines changed

src/System.Management.Automation/engine/ExecutionContext.cs

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,71 +1322,71 @@ internal void RemoveAssembly(string name)
13221322
[SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom")]
13231323
internal static Assembly LoadAssembly(string name, string filename, out Exception error)
13241324
{
1325-
// First we try to load the assembly based on the filename
1326-
1327-
Assembly loadedAssembly = null;
1328-
error = null;
1329-
1330-
if (!String.IsNullOrEmpty(filename))
1331-
{
1332-
try
1333-
{
1334-
loadedAssembly = Assembly.LoadFrom(filename);
1335-
}
1336-
catch (FileNotFoundException fileNotFound)
1337-
{
1338-
error = fileNotFound;
1339-
}
1340-
catch (FileLoadException fileLoadException)
1341-
{
1342-
error = fileLoadException;
1343-
}
1344-
catch (BadImageFormatException badImage)
1345-
{
1346-
error = badImage;
1347-
}
1348-
catch (SecurityException securityException)
1349-
{
1350-
error = securityException;
1351-
}
1352-
}
1353-
else if (!String.IsNullOrEmpty(name))
1354-
{
1355-
string fixedName = null;
1356-
// Remove the '.dll' if it's there...
1357-
fixedName = name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)
1358-
? Path.GetFileNameWithoutExtension(name)
1359-
: name;
1360-
1361-
var assemblyString = Utils.IsPowerShellAssembly(fixedName)
1362-
? Utils.GetPowerShellAssemblyStrongName(fixedName)
1363-
: fixedName;
1364-
1365-
try
1366-
{
1367-
loadedAssembly = Assembly.Load(new AssemblyName(assemblyString));
1368-
}
1369-
catch (FileNotFoundException fileNotFound)
1370-
{
1371-
error = fileNotFound;
1372-
}
1373-
catch (FileLoadException fileLoadException)
1374-
{
1375-
error = fileLoadException;
1376-
// this is a legitimate error on CoreCLR for a newly emited with Add-Type assemblies
1377-
// they cannot be loaded by name, but we are only interested in importing them by path
1378-
}
1379-
catch (BadImageFormatException badImage)
1380-
{
1381-
error = badImage;
1382-
}
1383-
catch (SecurityException securityException)
1384-
{
1385-
error = securityException;
1386-
}
1387-
}
1388-
1389-
// We either return the loaded Assembly, or return null.
1325+
// First we try to load the assembly based on the filename
1326+
1327+
Assembly loadedAssembly = null;
1328+
error = null;
1329+
1330+
if (!String.IsNullOrEmpty(filename))
1331+
{
1332+
try
1333+
{
1334+
loadedAssembly = Assembly.LoadFrom(filename);
1335+
}
1336+
catch (FileNotFoundException fileNotFound)
1337+
{
1338+
error = fileNotFound;
1339+
}
1340+
catch (FileLoadException fileLoadException)
1341+
{
1342+
error = fileLoadException;
1343+
}
1344+
catch (BadImageFormatException badImage)
1345+
{
1346+
error = badImage;
1347+
}
1348+
catch (SecurityException securityException)
1349+
{
1350+
error = securityException;
1351+
}
1352+
}
1353+
else if (!String.IsNullOrEmpty(name))
1354+
{
1355+
string fixedName = null;
1356+
// Remove the '.dll' if it's there...
1357+
fixedName = name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)
1358+
? Path.GetFileNameWithoutExtension(name)
1359+
: name;
1360+
1361+
var assemblyString = Utils.IsPowerShellAssembly(fixedName)
1362+
? Utils.GetPowerShellAssemblyStrongName(fixedName)
1363+
: fixedName;
1364+
1365+
try
1366+
{
1367+
loadedAssembly = Assembly.Load(new AssemblyName(assemblyString));
1368+
}
1369+
catch (FileNotFoundException fileNotFound)
1370+
{
1371+
error = fileNotFound;
1372+
}
1373+
catch (FileLoadException fileLoadException)
1374+
{
1375+
error = fileLoadException;
1376+
// this is a legitimate error on CoreCLR for a newly emited with Add-Type assemblies
1377+
// they cannot be loaded by name, but we are only interested in importing them by path
1378+
}
1379+
catch (BadImageFormatException badImage)
1380+
{
1381+
error = badImage;
1382+
}
1383+
catch (SecurityException securityException)
1384+
{
1385+
error = securityException;
1386+
}
1387+
}
1388+
1389+
// We either return the loaded Assembly, or return null.
13901390
return loadedAssembly;
13911391
}
13921392

0 commit comments

Comments
 (0)