Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private Assembly Resolve(AssemblyLoadContext loadContext, AssemblyName assemblyN
// Try loading from GAC
if (!TryFindInGAC(assemblyName, out asmFilePath))
{
return null;
return null;
}
#else
return null;
Expand Down
26 changes: 13 additions & 13 deletions src/System.Management.Automation/CoreCLR/CorePsStub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,22 @@ internal static Type GetTypeForVarEnum(VarEnum vt)
/// 2. There is no Type to represent COM types. __ComObject is a private type, and Object is too
/// general.
/// </summary>
internal static Type GetManagedMarshalType(VarEnum varEnum) {
internal static Type GetManagedMarshalType(VarEnum varEnum)
{
Debug.Assert((varEnum & VarEnum.VT_BYREF) == 0);

if (varEnum == VarEnum.VT_CY) {
if (varEnum == VarEnum.VT_CY)
{
return typeof(CurrencyWrapper);
}

if (IsPrimitiveType(varEnum)) {
if (IsPrimitiveType(varEnum))
{
return _ComToManagedPrimitiveTypes[varEnum];
}

switch (varEnum) {
switch (varEnum)
{
case VarEnum.VT_EMPTY:
case VarEnum.VT_NULL:
case VarEnum.VT_UNKNOWN:
Expand All @@ -299,7 +303,7 @@ internal static Type GetManagedMarshalType(VarEnum varEnum) {
return typeof(ErrorWrapper);

default:
throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.CurrentCulture, ParserStrings.UnexpectedVarEnum, varEnum));;
throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.CurrentCulture, ParserStrings.UnexpectedVarEnum, varEnum));
}
}

Expand Down Expand Up @@ -341,12 +345,10 @@ private static Dictionary<VarEnum, Type> CreateComToManagedPrimitiveTypes()
/// Primitive types are the basic COM types. It includes valuetypes like ints, but also reference types
/// like BStrs. It does not include composite types like arrays and user-defined COM types (IUnknown/IDispatch).
/// </summary>
internal static bool IsPrimitiveType(VarEnum varEnum) {
switch (varEnum) {

// *** BEGIN GENERATED CODE ***
// generated by function: gen_IsPrimitiveType from: generate_comdispatch.py

internal static bool IsPrimitiveType(VarEnum varEnum)
{
switch (varEnum)
{
case VarEnum.VT_I1:
case VarEnum.VT_I2:
case VarEnum.VT_I4:
Expand All @@ -366,8 +368,6 @@ internal static bool IsPrimitiveType(VarEnum varEnum) {
case VarEnum.VT_DATE:
case VarEnum.VT_BSTR:

// *** END GENERATED CODE ***

return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/System.Management.Automation/DscSupport/CimDSCParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,9 @@ public static void Initialize(Collection<Exception> errors, List<string> moduleP

if (!Directory.Exists(systemResourceRoot))
{
configSystemPath = Platform.GetFolderPath(Environment.SpecialFolder.System);
systemResourceRoot = Path.Combine(configSystemPath, "Configuration");
inboxModulePath = InboxDscResourceModulePath;
configSystemPath = Platform.GetFolderPath(Environment.SpecialFolder.System);
systemResourceRoot = Path.Combine(configSystemPath, "Configuration");
inboxModulePath = InboxDscResourceModulePath;
}

var programFilesDirectory = Platform.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal void Initialize(string[] propertyNames, int screenColumnWidth, DisplayC
_propertyLabelsDisplayLength = 0; // reset max

// cache the cell lengths for each property
Span<int> propertyNameCellCounts = propertyNames.Length <= OutCommandInner.StackAllocThreshold ? stackalloc int[propertyNames.Length] : new int[propertyNames.Length];;
Span<int> propertyNameCellCounts = propertyNames.Length <= OutCommandInner.StackAllocThreshold ? stackalloc int[propertyNames.Length] : new int[propertyNames.Length];
for (int k = 0; k < propertyNames.Length; k++)
{
Debug.Assert(propertyNames[k] != null, "propertyNames[k] is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
for (int k = 0; k < scArray.Length; k++)
{
// for the last column, don't pad it with trailing spaces
if (k == scArray.Length-1)
if (k == scArray.Length - 1)
{
addPadding = false;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ private string GenerateRow(string[] values, ReadOnlySpan<int> alignment, Display
for (int k = 0; k < _si.columnInfo.Length; k++)
{
// don't pad the last column
if (k == _si.columnInfo.Length -1)
if (k == _si.columnInfo.Length - 1)
{
addPadding = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace Microsoft.PowerShell.Commands
/// </summary>
public class PSPropertyExpressionResult
{

/// <summary>
/// Create a property expression result containing the original object, matching property expression
/// and any exception generated during the match process.
Expand Down Expand Up @@ -323,7 +322,7 @@ private PSPropertyExpressionResult GetValue(PSObject target, bool eatExceptions)
CallSite<Func<CallSite, object, object>>.Create(
PSGetMemberBinder.Get(
_stringValue,
classScope: (Type) null,
classScope: (Type)null,
@static: false));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections;
using System.Management.Automation;
using System.Management.Automation.Host;
using System.Management.Automation.Internal;

using Microsoft.PowerShell.Commands.Internal.Format;

namespace Microsoft.PowerShell.Commands
{
using System;
using System.Collections;
using System.Management.Automation;
using System.Management.Automation.Host;
using System.Management.Automation.Internal;
using Microsoft.PowerShell.Commands.Internal.Format;

/// <summary>
/// Null sink to absorb pipeline output.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.ObjectModel;

namespace Microsoft.PowerShell.Cmdletization
{
using System;
using System.Collections.ObjectModel;

/// <summary>
/// Collection of method parameters and their arguments
/// used to invoke a method in an object model wrapped by <see cref="CmdletAdapter&lt;TObjectInstance&gt;"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Management.Automation;
using System.Text;

// TODO/FIXME: move this to Microsoft.PowerShell.Cim namespace (and move in source depot folder as well)

namespace Microsoft.PowerShell.Cmdletization.Cim
{
using System.Management.Automation;
using System.Text;

/// <summary>
/// Translates a <see cref="WildcardPattern"/> into a like-operand for WQL.
/// </summary>
Expand Down
Loading