diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs
index dbe6ed0c0bd..7d9ee05cac0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs
@@ -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";
///
/// Any using statements required by the auto-generated type.
@@ -182,7 +182,7 @@ public string[] Path
/// The literal path to the source code or DLL to load.
///
[Parameter(Mandatory = true, ParameterSetName = FromLiteralPathParameterSetName)]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
@@ -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();
@@ -1044,7 +1044,7 @@ private void CheckDuplicateTypes(Compilation compilation, out ConcurrentBag DuplicateSymbols = new ConcurrentBag();
public readonly ConcurrentBag UniqueSymbols = new ConcurrentBag();
@@ -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]))
{
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs
index c766a05c921..d72210c296a 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs
@@ -151,7 +151,7 @@ public string Path
///
[Parameter()]
[ValidateNotNullOrEmpty]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string LiteralPath
{
@@ -544,7 +544,7 @@ public String[] Path
///
[Parameter(ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
@@ -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
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs
index ac9840020b8..b108e673108 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs
@@ -53,7 +53,7 @@ public string Path
///
///
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string LiteralPath
{
get { return _path; }
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs
index 5c946659de1..c0031d1eb82 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs
@@ -57,7 +57,7 @@ public String Path
/// Literal path of the XML file
///
[Parameter(ParameterSetName = "ByLiteralPath", Mandatory = true)]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public String LiteralPath
{
get
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs
index 06c04741244..3e118b80811 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs
@@ -15,9 +15,9 @@ namespace Microsoft.PowerShell.Commands
///
/// Displays the hexidecimal equivalent of the input data.
///
- [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;
@@ -36,7 +36,7 @@ public sealed class FormatHex : PSCmdlet
///
[Parameter(Mandatory = true, ParameterSetName = "LiteralPath")]
[ValidateNotNullOrEmpty()]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string[] LiteralPath { get; set; }
///
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs
index 1ec5748358c..37da0cb56bd 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs
@@ -52,7 +52,7 @@ public string FilePath
/// mandatory file name to write to
///
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string LiteralPath
{
get
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs
index fb63659b4c8..1b03a933f67 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs
@@ -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
///
- [Parameter(ParameterSetName="StreamFormatting")]
+ [Parameter(ParameterSetName = "StreamFormatting")]
public SwitchParameter Stream
{
get { return _stream; }
@@ -48,11 +48,11 @@ public int Width
///
/// False to add a newline to the end of the output string, true if not.
///
- [Parameter(ParameterSetName="NoNewLineFormatting")]
+ [Parameter(ParameterSetName = "NoNewLineFormatting")]
public SwitchParameter NoNewline
{
get { return _noNewLine; }
- set { _noNewLine = value;}
+ set { _noNewLine = value; }
}
private bool _noNewLine = false;
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs
index 52d33789433..81de831674c 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs
@@ -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;
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs
index 45ebccbb3e1..16c8a592886 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs
@@ -43,7 +43,7 @@ public String[] Path
///
///
[Parameter(Mandatory = true, ParameterSetName = LiteralPathParameterSet, Position = 0, ValueFromPipelineByPropertyName = true)]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public String[] LiteralPath
{
get
@@ -275,21 +275,21 @@ protected void InitHasher(String Algorithm)
///
/// FileHashInfo class contains information about a file hash
///
- public class FileHashInfo
- {
+ public class FileHashInfo
+ {
///
/// Hash algorithm name
///
- public string Algorithm { get; set;}
+ public string Algorithm { get; set; }
///
/// Hash value
///
- public string Hash { get; set;}
+ public string Hash { get; set; }
///
/// File path
///
- public string Path { get; set;}
- }
+ public string Path { get; set; }
+ }
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
index 1d8b178cfc7..665ac28f71b 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
@@ -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)
{
@@ -67,5 +67,5 @@ protected override void ProcessRecord()
/// Parameter set name for DateTime OutputType.
///
private const string SinceParameterSet = "Since";
- }
+ }
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs
index d43dbd87ee1..3641d2fea24 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs
@@ -39,7 +39,7 @@ public class ImportAliasCommand : PSCmdlet
///
///
[Parameter(Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = LiteralPathParameterSetName)]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string LiteralPath
{
get
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs
index 0df8046f2cf..94dcabeeb2d 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs
@@ -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;
///
/// Path specified, using globbing to resolve
@@ -30,7 +30,7 @@ public class ImportPowerShellDataFileCommand : PSCmdlet
///
[Parameter(Mandatory = true, Position = 0, ParameterSetName = "ByLiteralPath", ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
@@ -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;
@@ -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);
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
index 2e81dbe3146..e635d383c32 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
@@ -1001,7 +1001,7 @@ public PSObject InputObject
///
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "LiteralFile")]
[FileinfoToString]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
index 9befe0c608e..c0c4b824bc0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
@@ -327,7 +327,7 @@ public SwitchParameter AllStats
_allStats = value;
}
}
-
+
private bool _allStats;
///
@@ -483,7 +483,7 @@ protected override void BeginProcessing()
}
// finally call the base class.
- base.BeginProcessing();
+ base.BeginProcessing();
}
///
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
index a83de507313..a8b7edbdf33 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
@@ -712,7 +712,7 @@ public int Compare(OrderByPropertyEntry lhs, OrderByPropertyEntry rhs)
return result;
}
- OrderByPropertyComparer _orderByPropertyComparer = null;
+ private OrderByPropertyComparer _orderByPropertyComparer = null;
}
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs
index dfc98d2c2b9..b19c3e76f09 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs
@@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Commands
[Alias("ral")]
public class RemoveAliasCommand : PSCmdlet
{
- #region Parameters
+ #region Parameters
///
/// The alias name to remove.
@@ -46,7 +46,7 @@ public class RemoveAliasCommand : PSCmdlet
///
protected override void ProcessRecord()
{
- foreach(string aliasName in Name)
+ foreach (string aliasName in Name)
{
AliasInfo existingAlias = null;
if (String.IsNullOrEmpty(Scope))
@@ -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);
}
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs
index 31c48d33000..5d4212c44d3 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs
@@ -44,7 +44,7 @@ public string[] Path
/// The literal path of the file to unblock
///
[Parameter(Mandatory = true, ParameterSetName = "ByLiteralPath", ValueFromPipelineByPropertyName = true)]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] LiteralPath
{
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs
index 50a9a2973cd..e564f40a779 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs
@@ -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)
{
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs
index 3a098965d6d..efa52d5e4c0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs
@@ -30,8 +30,8 @@ public override WebRequestMethod Method
///
/// gets or sets the parameter CustomMethod
///
- [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
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
index 20b72d0fe77..f35d111959f 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
@@ -262,8 +262,8 @@ public virtual WebRequestMethod Method
///
/// gets or sets the CustomMethod property
///
- [Parameter(Mandatory=true,ParameterSetName = "CustomMethod")]
- [Parameter(Mandatory=true,ParameterSetName = "CustomMethodNoProxy")]
+ [Parameter(Mandatory = true, ParameterSetName = "CustomMethod")]
+ [Parameter(Mandatory = true, ParameterSetName = "CustomMethodNoProxy")]
[Alias("CM")]
[ValidateNotNullOrEmpty]
public virtual string CustomMethod
@@ -280,8 +280,8 @@ public virtual string CustomMethod
///
/// gets or sets the NoProxy property
///
- [Parameter(Mandatory=true,ParameterSetName = "CustomMethodNoProxy")]
- [Parameter(Mandatory=true,ParameterSetName = "StandardMethodNoProxy")]
+ [Parameter(Mandatory = true, ParameterSetName = "CustomMethodNoProxy")]
+ [Parameter(Mandatory = true, ParameterSetName = "StandardMethodNoProxy")]
public virtual SwitchParameter NoProxy { get; set; }
#endregion
@@ -326,7 +326,7 @@ public virtual string CustomMethod
/// A value may be a collection of form values or single form value.
///
[Parameter]
- public virtual IDictionary Form {get; set;}
+ public virtual IDictionary Form { get; set; }
///
/// gets or sets the ContentType property
@@ -573,7 +573,7 @@ internal virtual void PrepareSession()
// supplying a credential overrides the UseDefaultCredentials setting
WebSession.UseDefaultCredentials = false;
}
- else if ((Credential != null || null!= Token) && Authentication != WebAuthenticationType.None)
+ else if ((Credential != null || null != Token) && Authentication != WebAuthenticationType.None)
{
ProcessAuthentication();
}
@@ -798,7 +798,7 @@ private string GetBearerAuthorizationHeader()
private void ProcessAuthentication()
{
- if(Authentication == WebAuthenticationType.Basic)
+ if (Authentication == WebAuthenticationType.Basic)
{
WebSession.Headers["Authorization"] = GetBasicAuthorizationHeader();
}
@@ -827,7 +827,7 @@ public sealed class HttpResponseException : HttpRequestException
///
/// Message for the exception
/// Response from the HTTP server
- public HttpResponseException (string message, HttpResponseMessage response) : base(message)
+ public HttpResponseException(string message, HttpResponseMessage response) : base(message)
{
Response = response;
}
@@ -1257,9 +1257,9 @@ internal virtual void FillRequestStream(HttpRequestMessage request)
}
// Returns true if the status code is one of the supported redirection codes.
- static bool IsRedirectCode(HttpStatusCode code)
+ private static bool IsRedirectCode(HttpStatusCode code)
{
- int intCode = (int) code;
+ int intCode = (int)code;
return
(
(intCode >= 300 && intCode < 304)
@@ -1270,7 +1270,7 @@ static bool IsRedirectCode(HttpStatusCode code)
// Returns true if the status code is a redirection code and the action requires switching from POST to GET on redirection.
// NOTE: Some of these status codes map to the same underlying value but spelling them out for completeness.
- static bool IsRedirectToGet(HttpStatusCode code)
+ private static bool IsRedirectToGet(HttpStatusCode code)
{
return
(
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs
index a1f4850ca84..d0e9bae55fd 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs
@@ -120,7 +120,7 @@ public Dictionary> Headers
{
get
{
- if(_headers == null)
+ if (_headers == null)
{
_headers = WebResponseHelper.GetHeadersDictionary(BaseResponse);
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs
index b1a3cbac05d..7622d684a1a 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs
@@ -183,7 +183,7 @@ private object ProcessValue(object obj, int depth)
}
else if (obj is Newtonsoft.Json.Linq.JObject jObject)
{
- rv = jObject.ToObject>();
+ rv = jObject.ToObject>();
}
else
{
@@ -445,6 +445,6 @@ private object ProcessCustomObject(object o, int depth)
///
/// Exception used for Stopping.
///
- private class StoppingException : System.Exception {}
+ private class StoppingException : System.Exception { }
}
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs
index 0c1f9e63cab..87b20f68476 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs
@@ -129,7 +129,8 @@ internal static string PlatformName
if (Platform.IsWindows)
{
// only generate the windows user agent once
- if(s_windowsUserAgent == null){
+ if (s_windowsUserAgent == null)
+ {
// find the version in the windows operating system description
Regex pattern = new Regex(@"\d+(\.\d+)+");
string versionText = pattern.Match(OS).Value;
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs
index 10e7f4229a8..b034eaee40b 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs
@@ -343,7 +343,7 @@ internal static void WriteToStream(byte[] input, Stream output)
internal static void SaveStreamToFile(Stream stream, string filePath, PSCmdlet cmdlet)
{
// If the web cmdlet should resume, append the file instead of overwriting.
- if(cmdlet is WebRequestPSCmdlet webCmdlet && webCmdlet.ShouldResume)
+ if (cmdlet is WebRequestPSCmdlet webCmdlet && webCmdlet.ShouldResume)
{
using (FileStream output = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.Read))
{
@@ -432,7 +432,7 @@ internal static bool TryGetEncoding(string characterSet, out Encoding encoding)
return result;
}
- static readonly Regex s_metaexp = new Regex(@"<]*charset\s*=\s*[""'\n]?(?[A-Za-z].[^\s""'\n<>]*)[\s""'\n>]");
+ private static readonly Regex s_metaexp = new Regex(@"<]*charset\s*=\s*[""'\n]?(?[A-Za-z].[^\s""'\n<>]*)[\s""'\n>]");
internal static string DecodeStream(Stream stream, ref Encoding encoding)
{
@@ -444,25 +444,28 @@ internal static string DecodeStream(Stream stream, ref Encoding encoding)
isDefaultEncoding = true;
}
- string content = StreamToString (stream, encoding);
- if (isDefaultEncoding) do
+ string content = StreamToString(stream, encoding);
+ if (isDefaultEncoding)
{
- // check for a charset attribute on the meta element to override the default.
- Match match = s_metaexp.Match(content);
- if (match.Success)
+ do
{
- Encoding localEncoding = null;
- string characterSet = match.Groups["charset"].Value;
-
- if (TryGetEncoding(characterSet, out localEncoding))
+ // check for a charset attribute on the meta element to override the default.
+ Match match = s_metaexp.Match(content);
+ if (match.Success)
{
- stream.Seek(0, SeekOrigin.Begin);
- content = StreamToString(stream, localEncoding);
- // report the encoding used.
- encoding = localEncoding;
+ Encoding localEncoding = null;
+ string characterSet = match.Groups["charset"].Value;
+
+ if (TryGetEncoding(characterSet, out localEncoding))
+ {
+ stream.Seek(0, SeekOrigin.Begin);
+ content = StreamToString(stream, localEncoding);
+ // report the encoding used.
+ encoding = localEncoding;
+ }
}
- }
- } while (false);
+ } while (false);
+ }
return content;
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
index 635eba5418c..ff4e2246ac1 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
@@ -45,7 +45,7 @@ public sealed class ExportClixmlCommand : PSCmdlet, IDisposable
/// mandatory file name to write to
///
[Parameter(Mandatory = true, ParameterSetName = "ByLiteralPath")]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string LiteralPath
{
get
@@ -296,7 +296,7 @@ public sealed class ImportClixmlCommand : PSCmdlet, IDisposable
/// mandatory file name to read from
///
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public String[] LiteralPath
{
@@ -825,7 +825,7 @@ public class SelectXmlCommand : PSCmdlet
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "LiteralPath")]
[ValidateNotNullOrEmpty]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public String[] LiteralPath
{
get { return Path; }
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs
index ddbbe6c17f4..1d9eef7c0af 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs
@@ -423,7 +423,7 @@ protected override void BeginProcessing()
if (!_fragment)
{
- if(!_transitional)
+ if (!_transitional)
{
WriteObject("");
}
@@ -433,17 +433,19 @@ protected override void BeginProcessing()
}
WriteObject("");
WriteObject("");
- if(_charsetSpecified)
+ if (_charsetSpecified)
{
WriteObject("");
}
- if(_metaSpecified)
+ if (_metaSpecified)
{
List useditems = new List();
- foreach(string s in _meta.Keys)
+ foreach (string s in _meta.Keys)
{
- if(!useditems.Contains(s)){
- switch(s.ToLower()){
+ if (!useditems.Contains(s))
+ {
+ switch (s.ToLower())
+ {
case "content-type":
case "default-style":
case "x-ua-compatible":
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs
index eeab0052255..f8201aa79c7 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs
@@ -276,7 +276,7 @@ public PSObject StreamingDequeue()
}
private int _streamedObjectCount;
- private int _first,_last,_skip,_skipLast;
+ private int _first, _last, _skip, _skipLast;
private bool _firstOrLastSpecified;
}
@@ -332,7 +332,7 @@ private void ProcessExpressionParameter()
// ExcludeProperty implies -Property * for better UX
if ((Property == null) || (Property.Length == 0))
{
- Property = new Object[]{"*"};
+ Property = new Object[] { "*" };
_propertyMshParameterList = processor.ProcessParameters(Property, invocationContext);
}
}
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs
index e322af31fe5..58ce0a108f5 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs
@@ -12,7 +12,7 @@ namespace Microsoft.PowerShell.Commands
[Cmdlet("Sort",
"Object",
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113403",
- DefaultParameterSetName="Default",
+ DefaultParameterSetName = "Default",
RemotingCapability = RemotingCapability.None)]
public sealed class SortObjectCommand : OrderObjectBase
{
@@ -42,15 +42,15 @@ public SwitchParameter Unique
///
/// This param specifies you only want the top N items returned.
///
- [Parameter(ParameterSetName="Default")]
- [ValidateRange(1,int.MaxValue)]
+ [Parameter(ParameterSetName = "Default")]
+ [ValidateRange(1, int.MaxValue)]
public int Top { get; set; } = 0;
///
/// This param specifies you only want the bottom N items returned.
///
- [Parameter(ParameterSetName="Bottom", Mandatory=true)]
- [ValidateRange(1,int.MaxValue)]
+ [Parameter(ParameterSetName = "Bottom", Mandatory = true)]
+ [ValidateRange(1, int.MaxValue)]
public int Bottom { get; set; } = 0;
///
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs
index 53b7e901b93..78c958eb0bb 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs
@@ -40,7 +40,7 @@ public string FilePath
/// Literal FilePath parameter
///
[Parameter(Mandatory = true, ParameterSetName = "LiteralFile")]
- [Alias("PSPath","LP")]
+ [Alias("PSPath", "LP")]
public string LiteralPath
{
get
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs
index bc06b1a6663..31b89b0c3a7 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs
@@ -62,7 +62,7 @@ public TraceOptions ListenerOption
///
///
[Parameter(ParameterSetName = "optionsSet")]
- [Alias("PSPath","Path")]
+ [Alias("PSPath", "Path")]
public string FilePath
{
get { return base.FileListener; }
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
index 93208063e7d..205bb90a06a 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
@@ -96,7 +96,7 @@ public TraceOptions ListenerOption
///
///
[Parameter]
- [Alias("PSPath","Path")]
+ [Alias("PSPath", "Path")]
public string FilePath
{
get { return base.FileListener; }