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
2 changes: 1 addition & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ dotnet_diagnostic.SA1514.severity = none
dotnet_diagnostic.SA1515.severity = none

# SA1516: Elements should be separated by blank line
dotnet_diagnostic.SA1516.severity = none
dotnet_diagnostic.SA1516.severity = warning

# SA1517: Code should not contain blank lines at start of file
dotnet_diagnostic.SA1517.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@ protected static string GetLanguageName(uint? lcid)
return null;
}
}

#pragma warning disable 649 // fields and properties in these class are assigned dynamically
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Class is instantiated directly from a CIM instance")]
internal class WmiBaseBoard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public Encoding Encoding
{
return _encoding;
}

set
{
EncodingConversion.WarnIfObsolete(this, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ protected override void BeginProcessing()
// the values to be written
}
}

/// <summary>
/// </summary>
protected override void ProcessRecord()
Expand Down Expand Up @@ -155,6 +156,7 @@ public void Dispose()
{
Dispose(false);
}

#region private
private CommandWrapper _commandWrapper;
private bool _alreadyDisposed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void GetPath(
uint fFlags);

void GetIDList(out IntPtr ppidl);

void SetIDList(IntPtr pidl);

void GetDescription(
Expand All @@ -82,8 +83,11 @@ void SetArguments(
[MarshalAs(UnmanagedType.LPWStr)] string pszArgs);

void GetHotKey(out short wHotKey);

void SetHotKey(short wHotKey);

void GetShowCmd(out uint iShowCmd);

void SetShowCmd(uint iShowCmd);

void GetIconLocation(
Expand Down Expand Up @@ -234,6 +238,7 @@ void AddFromArray(
[MarshalAs(UnmanagedType.Interface)] IObjectArray poaSource);

void RemoveObject(uint uiIndex);

void Clear();
}

Expand All @@ -252,6 +257,7 @@ internal interface IShellLinkDataListW
Int32 RemoveDataBlock(UInt32 dwSig);

void GetFlags(out uint pdwFlags);

void SetFlags(uint dwFlags);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ internal string? ConfigurationName
AssertArgumentsParsed();
return _configurationName;
}

set
{
if (!string.IsNullOrEmpty(value))
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2986,9 +2986,13 @@ internal RunspaceCreationEventArgs(
}

internal string InitialCommand { get; set; }

internal bool SkipProfiles { get; set; }

internal bool StaMode { get; set; }

internal string ConfigurationName { get; set; }

internal Collection<CommandParameter> InitialCommandArgs { get; set; }
}
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -1345,23 +1345,29 @@ public override void WriteErrorLine(string value)

// Error colors
public ConsoleColor ErrorAccentColor { get; set; } = ConsoleColor.Cyan;

public ConsoleColor ErrorForegroundColor { get; set; } = ConsoleColor.Red;

public ConsoleColor ErrorBackgroundColor { get; set; } = Console.BackgroundColor;

// Warning colors
public ConsoleColor WarningForegroundColor { get; set; } = ConsoleColor.Yellow;

public ConsoleColor WarningBackgroundColor { get; set; } = Console.BackgroundColor;

// Debug colors
public ConsoleColor DebugForegroundColor { get; set; } = ConsoleColor.Yellow;

public ConsoleColor DebugBackgroundColor { get; set; } = Console.BackgroundColor;

// Verbose colors
public ConsoleColor VerboseForegroundColor { get; set; } = ConsoleColor.Yellow;

public ConsoleColor VerboseBackgroundColor { get; set; } = Console.BackgroundColor;

// Progress colors
public ConsoleColor ProgressForegroundColor { get; set; } = ConsoleColor.Black;

public ConsoleColor ProgressBackgroundColor { get; set; } = ConsoleColor.Yellow;

#endregion Line-oriented interaction
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// Licensed under the MIT License.

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("System.Management.Automation,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ internal static extern unsafe uint EventWriteString(
[In] long keywords,
[In] char* message
);

// ActivityId Control APIs
[DllImport(EventProviderDllName, ExactSpelling = true, EntryPoint = "EventActivityIdControl", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
[SecurityCritical]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ internal class CimDSCParser
{
private CimMofDeserializer _deserializer;
private CimMofDeserializer.OnClassNeeded _onClassNeeded;

/// <summary>
/// </summary>
internal CimDSCParser(CimMofDeserializer.OnClassNeeded onClassNeeded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ internal class FormatMessagesContextManager
{
// callbacks declarations
internal delegate OutputContext FormatContextCreationCallback(OutputContext parentContext, FormatInfoData formatData);

internal delegate void FormatStartCallback(OutputContext c);

internal delegate void FormatEndCallback(FormatEndData fe, OutputContext c);

internal delegate void GroupStartCallback(OutputContext c);

internal delegate void GroupEndCallback(GroupEndData fe, OutputContext c);

internal delegate void PayloadCallback(FormatEntryData formatEntryData, OutputContext c);

// callback instances
Expand Down
1 change: 1 addition & 0 deletions src/System.Management.Automation/engine/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ public ParameterAttribute(string experimentName, ExperimentAction experimentActi
public ExperimentAction ExperimentAction { get; }

internal bool ToHide => EffectiveAction == ExperimentAction.Hide;

internal bool ToShow => EffectiveAction == ExperimentAction.Show;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,29 @@ internal class CompletionContext
// This is how we can tell if we're trying to complete part of something (like a member)
// or complete an argument, where TokenBeforeCursor could be a parameter name.
internal Token TokenAtCursor { get; set; }

internal Token TokenBeforeCursor { get; set; }

internal IScriptPosition CursorPosition { get; set; }

internal PowerShellExecutionHelper Helper { get; set; }

internal Hashtable Options { get; set; }

internal Dictionary<string, ScriptBlock> CustomArgumentCompleters { get; set; }

internal Dictionary<string, ScriptBlock> NativeArgumentCompleters { get; set; }

internal string WordToComplete { get; set; }

internal int ReplacementIndex { get; set; }

internal int ReplacementLength { get; set; }

internal ExecutionContext ExecutionContext { get; set; }

internal PseudoBindingInfo PseudoBindingInfo { get; set; }

internal TypeInferenceContext TypeInferenceContext { get; set; }

internal bool GetOption(string option, bool @default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4086,7 +4086,9 @@ private static ArgumentLocation FindTargetArgumentLocation(Collection<AstParamet
private sealed class ArgumentLocation
{
internal bool IsPositional { get; set; }

internal int Position { get; set; }

internal AstParameterArgumentPair Argument { get; set; }
}

Expand Down Expand Up @@ -4999,6 +5001,7 @@ internal static List<CompletionResult> CompleteComment(CompletionContext context
new Tuple<string, string>("Where", "Where({ expression } [, mode [, numberToReturn]])"),
new Tuple<string, string>("ForEach", "ForEach(expression [, arguments...])")
};

// List of DSC collection-value variables
private static readonly HashSet<string> s_dscCollectionVariables =
new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "SelectedNodes", "AllNodes" };
Expand Down Expand Up @@ -5440,6 +5443,7 @@ private static bool IsConstructor(object member)
private abstract class TypeCompletionBase
{
internal abstract CompletionResult GetCompletionResult(string keyMatched, string prefix, string suffix);

internal abstract CompletionResult GetCompletionResult(string keyMatched, string prefix, string suffix, string namespaceToRemove);

internal static string RemoveBackTick(string typeName)
Expand Down Expand Up @@ -6956,6 +6960,7 @@ internal static bool TrySafeEval(ExpressionAst ast, ExecutionContext executionCo
public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) { return false; }

public object VisitAssignmentStatement(AssignmentStatementAst assignmentStatementAst) { return false; }

// REVIEW: we could relax this to allow specific commands
public object VisitCommand(CommandAst commandAst) { return false; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ internal virtual ObsoleteAttribute ObsoleteAttribute
{
get { return null; }
}

// Full Qualified ID for the obsolete command warning
private const string FQIDCommandObsolete = "CommandObsolete";

Expand Down
1 change: 1 addition & 0 deletions src/System.Management.Automation/engine/CoreAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,7 @@ internal ParameterizedPropertyCacheEntry(List<PropertyInfo> properties)
internal class PropertyCacheEntry : CacheEntry
{
internal delegate object GetterDelegate(object instance);

internal delegate void SetterDelegate(object instance, object setValue);

internal PropertyCacheEntry(PropertyInfo property)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ internal abstract class Node
public Node Operand1 { get; set; }

internal abstract bool Eval(object val);

internal abstract bool ExistEnum(object enumVal);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ internal HelpSystem HelpSystem
#endregion

internal Dictionary<string, ScriptBlock> CustomArgumentCompleters { get; set; }

internal Dictionary<string, ScriptBlock> NativeArgumentCompleters { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ internal static void ValidateArguments(string experimentName, ExperimentAction e
}

internal bool ToHide => EffectiveAction == ExperimentAction.Hide;

internal bool ToShow => EffectiveAction == ExperimentAction.Show;

/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ internal static string ReadScript(string path)
}

internal List<string> DiscoveredExports { get; set; }

internal Dictionary<string, string> DiscoveredAliases { get; set; }

internal List<RequiredModuleInfo> DiscoveredModules { get; set; }

internal List<string> DiscoveredCommandFilters { get; set; }

internal bool AddsSelfToPath { get; set; }

internal List<TypeDefinitionAst> DiscoveredClasses { get; set; }
}

Expand Down Expand Up @@ -160,11 +165,17 @@ static ExportVisitor()
private readonly bool _forCompletion;

internal List<string> DiscoveredExports { get; set; }

internal List<RequiredModuleInfo> DiscoveredModules { get; set; }

internal Dictionary<string, FunctionDefinitionAst> DiscoveredFunctions { get; set; }

internal Dictionary<string, string> DiscoveredAliases { get; set; }

internal List<string> DiscoveredCommandFilters { get; set; }

internal bool AddsSelfToPath { get; set; }

internal List<TypeDefinitionAst> DiscoveredClasses { get; set; }

public override AstVisitAction VisitTypeDefinition(TypeDefinitionAst typeDefinitionAst)
Expand Down Expand Up @@ -564,6 +575,7 @@ private struct ParameterInfo
internal class RequiredModuleInfo
{
internal string Name { get; set; }

internal List<string> CommandsToPostFilter { get; set; }
}
}
5 changes: 5 additions & 0 deletions src/System.Management.Automation/engine/MshObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ internal static PSObject ConstructPSObjectFromSerializationInfo(SerializationInf
new PSObject.AdapterSet(new ThirdPartyAdapter(typeof(Microsoft.Management.Infrastructure.CimInstance),
new Microsoft.PowerShell.Cim.CimInstanceAdapter()),
PSObject.DotNetInstanceAdapter);

#if !UNIX
private static readonly AdapterSet s_managementObjectAdapter = new AdapterSet(new ManagementObjectAdapter(), DotNetInstanceAdapter);
private static readonly AdapterSet s_managementClassAdapter = new AdapterSet(new ManagementClassApdapter(), DotNetInstanceAdapter);
Expand Down Expand Up @@ -946,6 +947,7 @@ public static implicit operator PSObject(int valueToConvert)
{
return PSObject.AsPSObject(valueToConvert);
}

/// <summary>
/// </summary>
/// <param name="valueToConvert"></param>
Expand All @@ -954,6 +956,7 @@ public static implicit operator PSObject(string valueToConvert)
{
return PSObject.AsPSObject(valueToConvert);
}

/// <summary>
/// </summary>
/// <param name="valueToConvert"></param>
Expand All @@ -962,6 +965,7 @@ public static implicit operator PSObject(Hashtable valueToConvert)
{
return PSObject.AsPSObject(valueToConvert);
}

/// <summary>
/// </summary>
/// <param name="valueToConvert"></param>
Expand All @@ -970,6 +974,7 @@ public static implicit operator PSObject(double valueToConvert)
{
return PSObject.AsPSObject(valueToConvert);
}

/// <summary>
/// </summary>
/// <param name="valueToConvert"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ internal GettingValueExceptionEventArgs(Exception exception)
public class PSObjectPropertyDescriptor : PropertyDescriptor
{
internal event EventHandler<SettingValueExceptionEventArgs> SettingValueException;

internal event EventHandler<GettingValueExceptionEventArgs> GettingValueException;

internal PSObjectPropertyDescriptor(string propertyName, Type propertyType, bool isReadOnly, AttributeCollection propertyAttributes)
Expand Down
Loading