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 @@ -60,7 +60,7 @@ internal ColumnPicker(
: this()
{
ArgumentNullException.ThrowIfNull(columns);

ArgumentNullException.ThrowIfNull(availableColumns);

// Add visible columns to Selected list, preserving order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CimJobException(string message, Exception inner) : base(message, inner)
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
[Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]
[Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]
protected CimJobException(
SerializationInfo info,
StreamingContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public override void FilterByAssociatedInstance(object associatedInstance, strin
public override void AddQueryOption(string optionName, object optionValue)
{
ArgumentException.ThrowIfNullOrEmpty(optionName);
ArgumentNullException.ThrowIfNull(optionValue);
ArgumentNullException.ThrowIfNull(optionValue);

this.queryOptions[optionName] = optionValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ internal static string WqlQueryAll(string from)
internal static T[] GetAll<T>(CimSession session, string nameSpace, string wmiClassName) where T : class, new()
{
ArgumentException.ThrowIfNullOrEmpty(wmiClassName);

var rv = new List<T>();

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ private bool FiltersMatch(EventLogEntry entry)
}
}

if (!usernamematch)
if (!usernamematch)
{
return usernamematch;
}
Expand Down Expand Up @@ -595,7 +595,7 @@ private bool FiltersMatch(EventLogEntry entry)
}
}

if (!datematch)
if (!datematch)
{
return datematch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3685,7 +3685,7 @@ public enum DeviceGuardHardwareSecure
/// Secure Memory Overwrite.
/// </summary>
SecureMemoryOverwrite = 4,

/// <summary>
/// UEFI Code Readonly.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public SwitchParameter Relative
/// </summary>
[Parameter]
public string RelativeBasePath
{
{
get
{
return _relativeBasePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected override void ProcessRecord()
{
WriteObject(result);
}

continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ private object InstantiateWebServiceProxy(Assembly assembly)
break;
}

if (proxyType != null)
if (proxyType != null)
{
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ internal static IList<string> BuildPropertyNames(PSObject source, IList<string>
/// <returns>Converted string.</returns>
internal string ConvertPropertyNamesCSV(IList<string> propertyNames)
{
ArgumentNullException.ThrowIfNull(propertyNames);
ArgumentNullException.ThrowIfNull(propertyNames);

_outputString.Clear();
bool first = true;
Expand Down Expand Up @@ -994,7 +994,7 @@ internal string ConvertPropertyNamesCSV(IList<string> propertyNames)
AppendStringWithEscapeAlways(_outputString, propertyName);
break;
case BaseCsvWritingCommand.QuoteKind.AsNeeded:

if (propertyName.AsSpan().IndexOfAny(_delimiter, '\n', '"') != -1)
{
AppendStringWithEscapeAlways(_outputString, propertyName);
Expand Down Expand Up @@ -1023,7 +1023,7 @@ internal string ConvertPropertyNamesCSV(IList<string> propertyNames)
/// <returns></returns>
internal string ConvertPSObjectToCSV(PSObject mshObject, IList<string> propertyNames)
{
ArgumentNullException.ThrowIfNull(propertyNames);
ArgumentNullException.ThrowIfNull(propertyNames);

_outputString.Clear();
bool first = true;
Expand Down Expand Up @@ -1109,7 +1109,7 @@ internal string ConvertPSObjectToCSV(PSObject mshObject, IList<string> propertyN
/// <returns>ToString() value.</returns>
internal static string GetToStringValueForProperty(PSPropertyInfo property)
{
ArgumentNullException.ThrowIfNull(property);
ArgumentNullException.ThrowIfNull(property);

string value = null;
try
Expand Down Expand Up @@ -1271,7 +1271,7 @@ internal class ImportCsvHelper

internal ImportCsvHelper(PSCmdlet cmdlet, char delimiter, IList<string> header, string typeName, StreamReader streamReader)
{
ArgumentNullException.ThrowIfNull(cmdlet);
ArgumentNullException.ThrowIfNull(cmdlet);
ArgumentNullException.ThrowIfNull(streamReader);

_cmdlet = cmdlet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected override void ProcessRecord()
ThrowTerminatingError(
new ErrorRecord(nse, "CannotDefineSupportedCommand", ErrorCategory.PermissionDenied, null));
}

SystemPolicy.LogWDACAuditMessage(
context: Context,
title: ImportLocalizedDataStrings.WDACLogTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ protected override void EndProcessing()
string errorId = (IsMeasuringGeneric) ? "GenericMeasurePropertyNotFound" : "TextMeasurePropertyNotFound";
WritePropertyNotFoundError(propertyName, errorId);
}

continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ protected override void BeginProcessing()
{
ThrowTerminatingError(
new ErrorRecord(
new PSNotSupportedException(NewObjectStrings.CannotCreateTypeConstrainedLanguage),
new PSNotSupportedException(NewObjectStrings.CannotCreateTypeConstrainedLanguage),
"CannotCreateTypeConstrainedLanguage",
ErrorCategory.PermissionDenied,
targetObject: null));
}

SystemPolicy.LogWDACAuditMessage(
context: Context,
title: NewObjectStrings.TypeWDACLogTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void ProcessRecord()
{
ErrorRecord error = new(ex, "StringNotRecognizedAsGuid", ErrorCategory.InvalidArgument, null);
WriteError(error);
}
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected override void ProcessRecord()
case "Milliseconds":
sleepTime = Milliseconds;
break;

case "FromTimeSpan":
if (Duration.TotalMilliseconds > int.MaxValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ static HttpVersionCompletionsAttribute()
/// <inheritdoc/>
public HttpVersionCompletionsAttribute() : base(AllowedVersions)
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected virtual void Dispose(bool disposing)
_cancellationSource.Dispose();
}
}

private readonly List<object> _inputObjects = new();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public bool Equals(WebProxy? other)
return false;
}

// _proxyAddress cannot be null as it is set in the constructor
// _proxyAddress cannot be null as it is set in the constructor
return other._credentials == _credentials
&& _proxyAddress.Equals(other._proxyAddress)
&& BypassProxyOnLocal == other.BypassProxyOnLocal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ internal TracePipelineWriter(
bool writeError,
Collection<PSTraceSource> matchingSources)
{
ArgumentNullException.ThrowIfNull(cmdlet);
ArgumentNullException.ThrowIfNull(cmdlet);
ArgumentNullException.ThrowIfNull(matchingSources);

_cmdlet = cmdlet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
namespace Microsoft.PowerShell
{
/// <summary>
/// HRESULT Wrapper
/// </summary>
/// HRESULT Wrapper
/// </summary>
internal enum HResult
{
/// <summary>
/// S_OK
/// </summary>
/// <summary>
/// S_OK
/// </summary>
Ok = 0x0000,

/// <summary>
/// S_FALSE.
/// </summary>
/// </summary>
False = 0x0001,

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell
/// <summary>
/// Executor wraps a Pipeline instance, and provides helper methods for executing commands in that pipeline. It is used to
/// provide bookkeeping and structure to the use of pipeline in such a way that they can be interrupted and cancelled by a
/// break event handler, and to track nesting of pipelines (which happens with interrupted input loops (aka subshells) and
/// break event handler, and to track nesting of pipelines (which happens with interrupted input loops (aka subshells) and
/// use of tab-completion in prompts). The bookkeeping is necessary because the break handler is static and global, and
/// there is no means for tying a break handler to an instance of an object.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected override
{
return;
}

try
{
string outFilename = Host.UI.StopTranscribing();
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.WSMan.Management/CredSSP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ private void EnableClientSideSettings()
try
{
XmlDocument xmldoc = new XmlDocument();

// push the xml string with credssp enabled
xmldoc.LoadXml(m_SessionObj.Put(helper.CredSSP_RUri, newxmlcontent, 0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3252,7 +3252,7 @@ public static bool ImportCimKeywordsFromModule(PSModuleInfo module, string resou
string tempSchemaFilepath = schemaFiles.FirstOrDefault();

Debug.Assert(schemaFiles.Count() == 1, "A valid DSCResource module can have only one schema mof file");

if (tempSchemaFilepath is not null)
{
var classes = GetCachedClassByFileName(tempSchemaFilepath) ?? ImportClasses(tempSchemaFilepath, new Tuple<string, Version>(module.Name, module.Version), errors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace System.Management.Automation.Runspaces
/// <summary>
/// This exception is used by Formattable constructor to indicate errors
/// occurred during construction time.
/// </summary>
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "FormatTable")]
public class FormatTableLoadException : RuntimeException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ private void Write12_Item(string n, string ns, global::Microsoft.PowerShell.Cmdl
{
WriteXsiType(@"CmdletParameterMetadataForGetCmdletFilteringParameter", @"http://schemas.microsoft.com/cmdlets-over-objects/2009/11");
}

if (o.@IsMandatorySpecified)
{
WriteAttribute(@"IsMandatory", @"", System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@IsMandatory)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ private static bool TryGetInferredCompletionsForAssignment(Ast expression, Compl
{
return false;
}

if (inferredTypes.Count == 0)
{
return false;
Expand Down Expand Up @@ -2613,7 +2613,7 @@ private static List<CompletionResult> CompleteLoopLabel(CompletionContext comple

return result;
}

private static List<CompletionResult> CompleteUsingKeywords(int cursorOffset, Token[] tokens, ref int replacementIndex, ref int replacementLength)
{
var result = new List<CompletionResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ internal static List<CompletionResult> CompleteModuleName(CompletionContext cont
// eg: Host<Tab> finds Microsoft.PowerShell.Host
// If the user has entered a manual wildcard, or a module name that contains a "." we assume they only want results that matches the input exactly.
bool shortNameSearch = wordToComplete.Length > 0 && !WildcardPattern.ContainsWildcardCharacters(wordToComplete) && !wordToComplete.Contains('.');

if (!wordToComplete.EndsWith('*'))
{
wordToComplete += "*";
}

string[] moduleNames;
WildcardPattern shortNamePattern;
if (shortNameSearch)
Expand Down Expand Up @@ -849,7 +849,7 @@ private static bool TryGetParameterHelpMessage(
[NotNullWhen(true)] out string? message)
{
message = null;

if (attr.HelpMessage is not null)
{
message = attr.HelpMessage;
Expand Down Expand Up @@ -927,7 +927,7 @@ private static List<CompletionResult> GetParameterCompletionResults(
addCommonParameters = false;
break;
}

if (helpMessage is null && TryGetParameterHelpMessage(pattr, commandAssembly, out string attrHelpMessage))
{
helpMessage = $" - {attrHelpMessage}";
Expand Down Expand Up @@ -4767,7 +4767,7 @@ private static List<CompletionResult> GetFileSystemProviderResults(
var resultType = isContainer
? CompletionResultType.ProviderContainer
: CompletionResultType.ProviderItem;

bool leafQuotesNeeded;
var completionText = NewPathCompletionText(
basePath,
Expand Down Expand Up @@ -4991,7 +4991,7 @@ private static string RebuildPathWithVars(
for (int i = 0; i < path.Length; i++)
{
// on Windows, we need to preserve the expanded home path as native commands don't understand it
#if UNIX
#if UNIX
if (i == homeIndex)
{
_ = sb.Append('~');
Expand Down Expand Up @@ -8613,7 +8613,7 @@ internal static string CombineVariableWithPartialPath(VariableExpressionAst vari
/// <param name="parametersToAdd">The parameters to add.</param>
/// <returns>Collection of command info objects.</returns>
internal static Collection<CommandInfo> GetCommandInfo(
IDictionary fakeBoundParameters,
IDictionary fakeBoundParameters,
params string[] parametersToAdd)
{
using var ps = PowerShell.Create(RunspaceMode.CurrentRunspace);
Expand Down
Loading
Loading