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 @@ -122,7 +122,7 @@ public String[] MemberDefinition
[Parameter(ParameterSetName = FromMemberParameterSetName)]
[AllowNull]
[Alias("NS")]
public String Namespace { get; set; } = "Microsoft.PowerShell.Commands.AddType.AutoGeneratedTypes";
public String Namespace { get; set; } = "Microsoft.PowerShell.Commands.AddType.AutoGeneratedTypes";

/// <summary>
/// Any using statements required by the auto-generated type.
Expand Down Expand Up @@ -182,7 +182,7 @@ public string[] Path
/// The literal path to the source code or DLL to load.
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = FromLiteralPathParameterSetName)]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
Expand Down Expand Up @@ -870,7 +870,7 @@ private SyntaxTree ParseSourceText(SourceText sourceText, ParseOptions parseOpti
switch (Language)
{
case Language.CSharp:
return CSharpSyntaxTree.ParseText(sourceText, (CSharpParseOptions) parseOptions, path);
return CSharpSyntaxTree.ParseText(sourceText, (CSharpParseOptions)parseOptions, path);

default:
throw PSTraceSource.NewNotSupportedException();
Expand Down Expand Up @@ -1044,7 +1044,7 @@ private void CheckDuplicateTypes(Compilation compilation, out ConcurrentBag<Stri
// Visit symbols in all namespaces and collect duplicates.
private class AllNamedTypeSymbolsVisitor : SymbolVisitor
{
int _hash;
private int _hash;

public readonly ConcurrentBag<String> DuplicateSymbols = new ConcurrentBag<String>();
public readonly ConcurrentBag<String> UniqueSymbols = new ConcurrentBag<String>();
Expand Down Expand Up @@ -1241,7 +1241,7 @@ private string BuildErrorMessage(Diagnostic diagnisticRecord)
sb.AppendLine(diagnisticMessage);
sb.AppendLine(errorLineString);

for (var i = 0 ; i < errorLineString.Length ; i++)
for (var i = 0; i < errorLineString.Length; i++)
{
if (!char.IsWhiteSpace(errorLineString[i]))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public string Path
/// </summary>
[Parameter()]
[ValidateNotNullOrEmpty]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string LiteralPath
{
Expand Down Expand Up @@ -544,7 +544,7 @@ public String[] Path
/// </summary>
[Parameter(ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
Expand Down Expand Up @@ -1265,10 +1265,12 @@ internal void ReadHeader()
{
values[0] = values[0].Substring(9);
Header = values;
} else if (values.Count != 0 && values[0].StartsWith("#"))
}
else if (values.Count != 0 && values[0].StartsWith("#"))
{
// Skip all lines starting with '#'
} else
}
else
{
// This is not W3C Extended Log File Format
// By default first line is Header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public string Path
/// </summary>
///
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public string LiteralPath
{
get { return _path; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public String Path
/// Literal path of the XML file
/// </summary>
[Parameter(ParameterSetName = "ByLiteralPath", Mandatory = true)]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public String LiteralPath
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Displays the hexidecimal equivalent of the input data.
/// </summary>
[Cmdlet(VerbsCommon.Format, "Hex", SupportsShouldProcess = true, HelpUri ="https://go.microsoft.com/fwlink/?LinkId=526919")]
[Cmdlet(VerbsCommon.Format, "Hex", SupportsShouldProcess = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=526919")]
[OutputType(typeof(Microsoft.PowerShell.Commands.ByteCollection))]
[Alias ("fhx")]
[Alias("fhx")]
public sealed class FormatHex : PSCmdlet
{
private const int BUFFERSIZE = 16;
Expand All @@ -36,7 +36,7 @@ public sealed class FormatHex : PSCmdlet
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = "LiteralPath")]
[ValidateNotNullOrEmpty()]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public string[] LiteralPath { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public string FilePath
/// mandatory file name to write to
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public string LiteralPath
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class OutStringCommand : FrontEndCommandBase
/// FALSE: accumulate all the data, then write a single string
/// TRUE: write one line at the time
/// </summary>
[Parameter(ParameterSetName="StreamFormatting")]
[Parameter(ParameterSetName = "StreamFormatting")]
public SwitchParameter Stream
{
get { return _stream; }
Expand All @@ -48,11 +48,11 @@ public int Width
/// <summary>
/// False to add a newline to the end of the output string, true if not.
/// </summary>
[Parameter(ParameterSetName="NoNewLineFormatting")]
[Parameter(ParameterSetName = "NoNewLineFormatting")]
public SwitchParameter NoNewline
{
get { return _noNewLine; }
set { _noNewLine = value;}
set { _noNewLine = value; }
}

private bool _noNewLine = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ private string UFormatDateString(DateTime dateTime)
}

// FirstFourDayWeek and DayOfWeek.Monday is from ISO 8601
sb.Append(StringUtil.Format("{0:00}",calender.GetWeekOfYear(normalizedDatetime,
sb.Append(StringUtil.Format("{0:00}", calender.GetWeekOfYear(normalizedDatetime,
CalendarWeekRule.FirstFourDayWeek,
DayOfWeek.Monday)));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String[] Path
/// </summary>
/// <value></value>
[Parameter(Mandatory = true, ParameterSetName = LiteralPathParameterSet, Position = 0, ValueFromPipelineByPropertyName = true)]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public String[] LiteralPath
{
get
Expand Down Expand Up @@ -275,21 +275,21 @@ protected void InitHasher(String Algorithm)
/// <summary>
/// FileHashInfo class contains information about a file hash
/// </summary>
public class FileHashInfo
{
public class FileHashInfo
{
/// <summary>
/// Hash algorithm name
/// </summary>
public string Algorithm { get; set;}
public string Algorithm { get; set; }

/// <summary>
/// Hash value
/// </summary>
public string Hash { get; set;}
public string Hash { get; set; }

/// <summary>
/// File path
/// </summary>
public string Path { get; set;}
}
public string Path { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override void ProcessRecord()
// InternalTestHooks.StopwatchIsNotHighResolution is used as test hook.
if (Stopwatch.IsHighResolution && !InternalTestHooks.StopwatchIsNotHighResolution)
{
TimeSpan uptime = TimeSpan.FromSeconds(Stopwatch.GetTimestamp()/Stopwatch.Frequency);
TimeSpan uptime = TimeSpan.FromSeconds(Stopwatch.GetTimestamp() / Stopwatch.Frequency);

switch (ParameterSetName)
{
Expand Down Expand Up @@ -67,5 +67,5 @@ protected override void ProcessRecord()
/// Parameter set name for DateTime OutputType.
/// </summary>
private const string SinceParameterSet = "Since";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ImportAliasCommand : PSCmdlet
/// </summary>
///
[Parameter(Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = LiteralPathParameterSetName)]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
public string LiteralPath
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Commands
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=623621", RemotingCapability = RemotingCapability.None)]
public class ImportPowerShellDataFileCommand : PSCmdlet
{
bool _isLiteralPath;
private bool _isLiteralPath;

/// <summary>
/// Path specified, using globbing to resolve
Expand All @@ -30,7 +30,7 @@ public class ImportPowerShellDataFileCommand : PSCmdlet
/// </summary>
[Parameter(Mandatory = true, Position = 0, ParameterSetName = "ByLiteralPath", ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
Expand All @@ -47,7 +47,7 @@ protected override void ProcessRecord()
foreach (var path in Path)
{
var resolved = PathUtils.ResolveFilePath(path, this, _isLiteralPath);
if(!string.IsNullOrEmpty(resolved) && System.IO.File.Exists(resolved))
if (!string.IsNullOrEmpty(resolved) && System.IO.File.Exists(resolved))
{
Token[] tokens;
ParseError[] errors;
Expand Down Expand Up @@ -86,7 +86,7 @@ private void WritePathNotFoundError(string path)
WriteError(errorRecord);
}

void WriteInvalidDataFileError(string resolvedPath, string errorId)
private void WriteInvalidDataFileError(string resolvedPath, string errorId)
{
var errorCategory = ErrorCategory.InvalidData;
var errorMessage = string.Format(UtilityResources.CouldNotParseAsPowerShellDataFile, resolvedPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ public PSObject InputObject
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "LiteralFile")]
[FileinfoToString]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public SwitchParameter AllStats
_allStats = value;
}
}

private bool _allStats;

/// <summary>
Expand Down Expand Up @@ -483,7 +483,7 @@ protected override void BeginProcessing()
}

// finally call the base class.
base.BeginProcessing();
base.BeginProcessing();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public int Compare(OrderByPropertyEntry lhs, OrderByPropertyEntry rhs)
return result;
}

OrderByPropertyComparer _orderByPropertyComparer = null;
private OrderByPropertyComparer _orderByPropertyComparer = null;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Commands
[Alias("ral")]
public class RemoveAliasCommand : PSCmdlet
{
#region Parameters
#region Parameters

/// <summary>
/// The alias name to remove.
Expand Down Expand Up @@ -46,7 +46,7 @@ public class RemoveAliasCommand : PSCmdlet
/// </summary>
protected override void ProcessRecord()
{
foreach(string aliasName in Name)
foreach (string aliasName in Name)
{
AliasInfo existingAlias = null;
if (String.IsNullOrEmpty(Scope))
Expand All @@ -65,7 +65,7 @@ protected override void ProcessRecord()
else
{
ItemNotFoundException notAliasFound = new ItemNotFoundException(StringUtil.Format(AliasCommandStrings.NoAliasFound, "name", aliasName));
ErrorRecord error = new ErrorRecord(notAliasFound, "ItemNotFoundException",ErrorCategory.ObjectNotFound, aliasName);
ErrorRecord error = new ErrorRecord(notAliasFound, "ItemNotFoundException", ErrorCategory.ObjectNotFound, aliasName);
WriteError(error);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string[] Path
/// The literal path of the file to unblock
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = "ByLiteralPath", ValueFromPipelineByPropertyName = true)]
[Alias("PSPath","LP")]
[Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,11 @@ protected override void ProcessRecord()
if (entries.Count > 0)
{
Context.FormatDBManager.UpdateDataBase(entries, this.Context.AuthorizationManager, this.Context.EngineHostInterface, false);
FormatAndTypeDataHelper.ThrowExceptionOnError( "ErrorsUpdatingFormats",
FormatAndTypeDataHelper.ThrowExceptionOnError("ErrorsUpdatingFormats",
null,
entries,
RunspaceConfigurationCategory.Formats);
}
}
}
catch (RuntimeException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public override WebRequestMethod Method
/// <summary>
/// gets or sets the parameter CustomMethod
/// </summary>
[Parameter(Mandatory=true,ParameterSetName = "CustomMethod")]
[Parameter(Mandatory=true,ParameterSetName = "CustomMethodNoProxy")]
[Parameter(Mandatory = true, ParameterSetName = "CustomMethod")]
[Parameter(Mandatory = true, ParameterSetName = "CustomMethodNoProxy")]
[Alias("CM")]
[ValidateNotNullOrEmpty]
public override string CustomMethod
Expand Down
Loading