Enable SA1001: Commas should be spaced correctly (#14171)
This commit is contained in:
parent
be7d36603d
commit
e92201779d
@ -1017,7 +1017,7 @@ dotnet_diagnostic.SA0002.severity = none
|
||||
dotnet_diagnostic.SA1000.severity = warning
|
||||
|
||||
# SA1001: Commas should be spaced correctly
|
||||
dotnet_diagnostic.SA1001.severity = none
|
||||
dotnet_diagnostic.SA1001.severity = warning
|
||||
|
||||
# SA1002: Semicolons should be spaced correctly
|
||||
dotnet_diagnostic.SA1002.severity = warning
|
||||
|
@ -404,15 +404,15 @@ namespace System.Diagnostics.Eventing
|
||||
|
||||
internal enum EvtEventMetadataPropertyId
|
||||
{
|
||||
EventMetadataEventID, // EvtVarTypeUInt32
|
||||
EventMetadataEventVersion, // EvtVarTypeUInt32
|
||||
EventMetadataEventChannel, // EvtVarTypeUInt32
|
||||
EventMetadataEventLevel, // EvtVarTypeUInt32
|
||||
EventMetadataEventOpcode, // EvtVarTypeUInt32
|
||||
EventMetadataEventTask, // EvtVarTypeUInt32
|
||||
EventMetadataEventKeyword, // EvtVarTypeUInt64
|
||||
EventMetadataEventMessageID,// EvtVarTypeUInt32
|
||||
EventMetadataEventTemplate // EvtVarTypeString
|
||||
EventMetadataEventID, // EvtVarTypeUInt32
|
||||
EventMetadataEventVersion, // EvtVarTypeUInt32
|
||||
EventMetadataEventChannel, // EvtVarTypeUInt32
|
||||
EventMetadataEventLevel, // EvtVarTypeUInt32
|
||||
EventMetadataEventOpcode, // EvtVarTypeUInt32
|
||||
EventMetadataEventTask, // EvtVarTypeUInt32
|
||||
EventMetadataEventKeyword, // EvtVarTypeUInt64
|
||||
EventMetadataEventMessageID, // EvtVarTypeUInt32
|
||||
EventMetadataEventTemplate // EvtVarTypeString
|
||||
// EvtEventMetadataPropertyIdEND
|
||||
}
|
||||
|
||||
@ -824,7 +824,7 @@ namespace System.Diagnostics.Eventing
|
||||
[SecurityCritical]
|
||||
internal static extern EventLogHandle EvtCreateRenderContext(
|
||||
Int32 valuePathsCount,
|
||||
[MarshalAs(UnmanagedType.LPArray,ArraySubType = UnmanagedType.LPWStr)]
|
||||
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]
|
||||
string[] valuePaths,
|
||||
[MarshalAs(UnmanagedType.I4)] EvtRenderContextFlags flags
|
||||
);
|
||||
|
@ -2715,16 +2715,16 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
||||
private static readonly Dictionary<Type, string> s_mapPrimitiveDotNetTypeToMof = new()
|
||||
{
|
||||
{ typeof(sbyte), "sint8" },
|
||||
{ typeof(byte) , "uint8"},
|
||||
{ typeof(short) , "sint16"},
|
||||
{ typeof(ushort) , "uint16"},
|
||||
{ typeof(int) , "sint32"},
|
||||
{ typeof(uint) , "uint32"},
|
||||
{ typeof(long) , "sint64"},
|
||||
{ typeof(byte), "uint8"},
|
||||
{ typeof(short), "sint16"},
|
||||
{ typeof(ushort), "uint16"},
|
||||
{ typeof(int), "sint32"},
|
||||
{ typeof(uint), "uint32"},
|
||||
{ typeof(long), "sint64"},
|
||||
{ typeof(ulong), "uint64" },
|
||||
{ typeof(float) , "real32"},
|
||||
{ typeof(double) , "real64"},
|
||||
{ typeof(bool) , "boolean"},
|
||||
{ typeof(float), "real32"},
|
||||
{ typeof(double), "real64"},
|
||||
{ typeof(bool), "boolean"},
|
||||
{ typeof(string), "string" },
|
||||
{ typeof(DateTime), "datetime" },
|
||||
{ typeof(PSCredential), "string" },
|
||||
|
@ -175,7 +175,7 @@ else { '-{0}{1} ' }) -f $_.Name, $parameterValue")
|
||||
.EndControl();
|
||||
|
||||
var sharedControls = new CustomControl[] {
|
||||
null,//MamlParameterValueGroupControl,
|
||||
null, //MamlParameterValueGroupControl,
|
||||
MamlParameterControl,
|
||||
MamlTypeControl,
|
||||
MamlParameterValueControl,
|
||||
|
@ -4628,7 +4628,7 @@ end {
|
||||
new SessionStateAliasEntry("gm", "Get-Member", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("gmo", "Get-Module", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("gp", "Get-ItemProperty", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("gpv", "Get-ItemPropertyValue", string.Empty,ReadOnly),
|
||||
new SessionStateAliasEntry("gpv", "Get-ItemPropertyValue", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("gps", "Get-Process", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("group", "Group-Object", string.Empty, ReadOnly),
|
||||
new SessionStateAliasEntry("gu", "Get-Unique", string.Empty, ReadOnly),
|
||||
@ -4787,7 +4787,7 @@ end {
|
||||
SessionStateFunctionEntry.GetDelayParsedFunctionEntry("cd\\", "Set-Location \\", isProductCode: true, languageMode: systemLanguageMode),
|
||||
// Win8: 320909. Retaining the original definition to ensure backward compatability.
|
||||
SessionStateFunctionEntry.GetDelayParsedFunctionEntry("Pause",
|
||||
string.Concat("$null = Read-Host '", CodeGeneration.EscapeSingleQuotedStringContent(RunspaceInit.PauseDefinitionString),"'"), isProductCode: true, languageMode: systemLanguageMode),
|
||||
string.Concat("$null = Read-Host '", CodeGeneration.EscapeSingleQuotedStringContent(RunspaceInit.PauseDefinitionString), "'"), isProductCode: true, languageMode: systemLanguageMode),
|
||||
SessionStateFunctionEntry.GetDelayParsedFunctionEntry("help", GetHelpPagingFunctionText(), isProductCode: true, languageMode: systemLanguageMode),
|
||||
SessionStateFunctionEntry.GetDelayParsedFunctionEntry("prompt", DefaultPromptFunctionText, isProductCode: true, languageMode: systemLanguageMode),
|
||||
|
||||
|
@ -629,18 +629,18 @@ namespace System.Management.Automation.Language
|
||||
};
|
||||
|
||||
private static readonly TokenKind[] s_keywordTokenKind = new TokenKind[] {
|
||||
/*1*/ TokenKind.ElseIf, TokenKind.If, TokenKind.Else, TokenKind.Switch, /*1*/
|
||||
/*2*/ TokenKind.Foreach, TokenKind.From, TokenKind.In, TokenKind.For, /*2*/
|
||||
/*3*/ TokenKind.While, TokenKind.Until, TokenKind.Do, TokenKind.Try, /*3*/
|
||||
/*4*/ TokenKind.Catch, TokenKind.Finally, TokenKind.Trap, TokenKind.Data, /*4*/
|
||||
/*5*/ TokenKind.Return, TokenKind.Continue, TokenKind.Break, TokenKind.Exit, /*5*/
|
||||
/*6*/ TokenKind.Throw, TokenKind.Begin, TokenKind.Process, TokenKind.End, /*6*/
|
||||
/*7*/ TokenKind.Dynamicparam, TokenKind.Function, TokenKind.Filter, TokenKind.Param, /*7*/
|
||||
/*8*/ TokenKind.Class, TokenKind.Define, TokenKind.Var, TokenKind.Using, /*8*/
|
||||
/*9*/ TokenKind.Workflow, TokenKind.Parallel, TokenKind.Sequence, TokenKind.InlineScript, /*9*/
|
||||
/*A*/ TokenKind.Configuration, TokenKind.Public, TokenKind.Private, TokenKind.Static, /*A*/
|
||||
/*B*/ TokenKind.Interface, TokenKind.Enum, TokenKind.Namespace,TokenKind.Module, /*B*/
|
||||
/*C*/ TokenKind.Type, TokenKind.Assembly, TokenKind.Command, TokenKind.Hidden, /*C*/
|
||||
/*1*/ TokenKind.ElseIf, TokenKind.If, TokenKind.Else, TokenKind.Switch, /*1*/
|
||||
/*2*/ TokenKind.Foreach, TokenKind.From, TokenKind.In, TokenKind.For, /*2*/
|
||||
/*3*/ TokenKind.While, TokenKind.Until, TokenKind.Do, TokenKind.Try, /*3*/
|
||||
/*4*/ TokenKind.Catch, TokenKind.Finally, TokenKind.Trap, TokenKind.Data, /*4*/
|
||||
/*5*/ TokenKind.Return, TokenKind.Continue, TokenKind.Break, TokenKind.Exit, /*5*/
|
||||
/*6*/ TokenKind.Throw, TokenKind.Begin, TokenKind.Process, TokenKind.End, /*6*/
|
||||
/*7*/ TokenKind.Dynamicparam, TokenKind.Function, TokenKind.Filter, TokenKind.Param, /*7*/
|
||||
/*8*/ TokenKind.Class, TokenKind.Define, TokenKind.Var, TokenKind.Using, /*8*/
|
||||
/*9*/ TokenKind.Workflow, TokenKind.Parallel, TokenKind.Sequence, TokenKind.InlineScript, /*9*/
|
||||
/*A*/ TokenKind.Configuration, TokenKind.Public, TokenKind.Private, TokenKind.Static, /*A*/
|
||||
/*B*/ TokenKind.Interface, TokenKind.Enum, TokenKind.Namespace, TokenKind.Module, /*B*/
|
||||
/*C*/ TokenKind.Type, TokenKind.Assembly, TokenKind.Command, TokenKind.Hidden, /*C*/
|
||||
/*D*/ TokenKind.Base, TokenKind.Default, /*D*/
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ namespace System.Management.Automation.Remoting
|
||||
// There is a limit of 104 characters in total including the temp path to the named pipe file
|
||||
// on non-Windows systems, so we'll convert the starttime to hex and just take the first 8 characters.
|
||||
#if UNIX
|
||||
.Append(proc.StartTime.ToFileTime().ToString("X8").Substring(1,8))
|
||||
.Append(proc.StartTime.ToFileTime().ToString("X8").Substring(1, 8))
|
||||
#else
|
||||
.Append(proc.StartTime.ToFileTime().ToString(CultureInfo.InvariantCulture))
|
||||
#endif
|
||||
|
@ -949,41 +949,41 @@ namespace System.Management.Automation.Remoting
|
||||
internal static readonly string VisibleExternalCommands = "VisibleExternalCommands";
|
||||
|
||||
internal static readonly ConfigTypeEntry[] ConfigFileKeys = new ConfigTypeEntry[] {
|
||||
new ConfigTypeEntry(AliasDefinitions, new ConfigTypeEntry.TypeValidationCallback(AliasDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(AssembliesToLoad, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Author, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(CompanyName, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Copyright, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Description, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnforceInputParameterValidation,new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnvironmentVariables, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(ExecutionPolicy, new ConfigTypeEntry.TypeValidationCallback(ExecutionPolicyValidationCallback)),
|
||||
new ConfigTypeEntry(FormatsToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(FunctionDefinitions, new ConfigTypeEntry.TypeValidationCallback(FunctionDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(GMSAAccount, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Guid, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(LanguageMode, new ConfigTypeEntry.TypeValidationCallback(LanguageModeValidationCallback)),
|
||||
new ConfigTypeEntry(ModulesToImport, new ConfigTypeEntry.TypeValidationCallback(StringOrHashtableArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(MountUserDrive, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(PowerShellVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RequiredGroups, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleCapabilities, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleCapabilityFiles, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleDefinitions, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccount, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccountGroups, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(SchemaVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(ScriptsToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(SessionType, new ConfigTypeEntry.TypeValidationCallback(ISSValidationCallback)),
|
||||
new ConfigTypeEntry(TranscriptDirectory, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(TypesToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(UserDriveMaxSize, new ConfigTypeEntry.TypeValidationCallback(IntegerTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VariableDefinitions, new ConfigTypeEntry.TypeValidationCallback(VariableDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleAliases, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleCmdlets, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleFunctions, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleProviders, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleExternalCommands, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(AliasDefinitions, new ConfigTypeEntry.TypeValidationCallback(AliasDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(AssembliesToLoad, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Author, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(CompanyName, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Copyright, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Description, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnforceInputParameterValidation, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnvironmentVariables, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(ExecutionPolicy, new ConfigTypeEntry.TypeValidationCallback(ExecutionPolicyValidationCallback)),
|
||||
new ConfigTypeEntry(FormatsToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(FunctionDefinitions, new ConfigTypeEntry.TypeValidationCallback(FunctionDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(GMSAAccount, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Guid, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(LanguageMode, new ConfigTypeEntry.TypeValidationCallback(LanguageModeValidationCallback)),
|
||||
new ConfigTypeEntry(ModulesToImport, new ConfigTypeEntry.TypeValidationCallback(StringOrHashtableArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(MountUserDrive, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(PowerShellVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RequiredGroups, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleCapabilities, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleCapabilityFiles, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleDefinitions, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccount, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccountGroups, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(SchemaVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(ScriptsToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(SessionType, new ConfigTypeEntry.TypeValidationCallback(ISSValidationCallback)),
|
||||
new ConfigTypeEntry(TranscriptDirectory, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(TypesToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(UserDriveMaxSize, new ConfigTypeEntry.TypeValidationCallback(IntegerTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VariableDefinitions, new ConfigTypeEntry.TypeValidationCallback(VariableDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleAliases, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleCmdlets, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleFunctions, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleProviders, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(VisibleExternalCommands, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -954,8 +954,8 @@ namespace System.Management.Automation
|
||||
// System.Management.Automation formats & types files
|
||||
Collection<string> types = new Collection<string>(new string[] { "types.ps1xml", "typesv3.ps1xml" });
|
||||
Collection<string> formats = new Collection<string>(new string[]
|
||||
{"Certificate.format.ps1xml","DotNetTypes.format.ps1xml","FileSystem.format.ps1xml",
|
||||
"Help.format.ps1xml","HelpV3.format.ps1xml","PowerShellCore.format.ps1xml","PowerShellTrace.format.ps1xml",
|
||||
{"Certificate.format.ps1xml", "DotNetTypes.format.ps1xml", "FileSystem.format.ps1xml",
|
||||
"Help.format.ps1xml", "HelpV3.format.ps1xml", "PowerShellCore.format.ps1xml", "PowerShellTrace.format.ps1xml",
|
||||
"Registry.format.ps1xml"});
|
||||
|
||||
string strongName = string.Format(CultureInfo.InvariantCulture, "{0}, Version={1}, Culture={2}, PublicKeyToken={3}, ProcessorArchitecture={4}",
|
||||
@ -1007,8 +1007,8 @@ namespace System.Management.Automation
|
||||
|
||||
// System.Management.Automation formats & types files
|
||||
Collection<string> smaFormats = new Collection<string>(new string[]
|
||||
{"Certificate.format.ps1xml","DotNetTypes.format.ps1xml","FileSystem.format.ps1xml",
|
||||
"Help.format.ps1xml","HelpV3.format.ps1xml","PowerShellCore.format.ps1xml","PowerShellTrace.format.ps1xml",
|
||||
{"Certificate.format.ps1xml", "DotNetTypes.format.ps1xml", "FileSystem.format.ps1xml",
|
||||
"Help.format.ps1xml", "HelpV3.format.ps1xml", "PowerShellCore.format.ps1xml", "PowerShellTrace.format.ps1xml",
|
||||
"Registry.format.ps1xml"});
|
||||
Collection<string> smaTypes = new Collection<string>(new string[] { "types.ps1xml", "typesv3.ps1xml" });
|
||||
|
||||
@ -1305,18 +1305,18 @@ namespace System.Management.Automation
|
||||
"GetEventResources,Description", "GetEventResources,Vendor"),
|
||||
#endif
|
||||
new DefaultPSSnapInInformation("Microsoft.PowerShell.Host", "Microsoft.PowerShell.ConsoleHost", null,
|
||||
"HostMshSnapInResources,Description","HostMshSnapInResources,Vendor"),
|
||||
"HostMshSnapInResources,Description", "HostMshSnapInResources,Vendor"),
|
||||
|
||||
s_coreSnapin,
|
||||
|
||||
new DefaultPSSnapInInformation("Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Commands.Utility", null,
|
||||
"UtilityMshSnapInResources,Description","UtilityMshSnapInResources,Vendor"),
|
||||
"UtilityMshSnapInResources,Description", "UtilityMshSnapInResources,Vendor"),
|
||||
|
||||
new DefaultPSSnapInInformation("Microsoft.PowerShell.Management", "Microsoft.PowerShell.Commands.Management", null,
|
||||
"ManagementMshSnapInResources,Description","ManagementMshSnapInResources,Vendor"),
|
||||
"ManagementMshSnapInResources,Description", "ManagementMshSnapInResources,Vendor"),
|
||||
|
||||
new DefaultPSSnapInInformation("Microsoft.PowerShell.Security", "Microsoft.PowerShell.Security", null,
|
||||
"SecurityMshSnapInResources,Description","SecurityMshSnapInResources,Vendor")
|
||||
"SecurityMshSnapInResources,Description", "SecurityMshSnapInResources,Vendor")
|
||||
};
|
||||
|
||||
#if !UNIX
|
||||
|
@ -28,7 +28,7 @@ namespace mvc.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Headers.Add("WWW-Authenticate","Basic realm=\"WebListener\"");
|
||||
Response.Headers.Add("WWW-Authenticate", "Basic realm=\"WebListener\"");
|
||||
Response.StatusCode = 401;
|
||||
return Json("401 Unauthorized");
|
||||
}
|
||||
@ -45,7 +45,7 @@ namespace mvc.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Headers.Add("WWW-Authenticate","Negotiate");
|
||||
Response.Headers.Add("WWW-Authenticate", "Negotiate");
|
||||
Response.StatusCode = 401;
|
||||
return Json("401 Unauthorized");
|
||||
}
|
||||
@ -62,7 +62,7 @@ namespace mvc.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Headers.Add("WWW-Authenticate","NTLM");
|
||||
Response.Headers.Add("WWW-Authenticate", "NTLM");
|
||||
Response.StatusCode = 401;
|
||||
return Json("401 Unauthorized");
|
||||
}
|
||||
|
@ -25,14 +25,14 @@ namespace mvc.Controllers
|
||||
{
|
||||
output = new Hashtable
|
||||
{
|
||||
{"Status" , "OK"},
|
||||
{"Thumbprint" , HttpContext.Connection.ClientCertificate.Thumbprint},
|
||||
{"Subject" , HttpContext.Connection.ClientCertificate.Subject},
|
||||
{"SubjectName" , HttpContext.Connection.ClientCertificate.SubjectName.Name},
|
||||
{"Issuer" , HttpContext.Connection.ClientCertificate.Issuer},
|
||||
{"IssuerName" , HttpContext.Connection.ClientCertificate.IssuerName.Name},
|
||||
{"NotAfter" , HttpContext.Connection.ClientCertificate.NotAfter},
|
||||
{"NotBefore" , HttpContext.Connection.ClientCertificate.NotBefore}
|
||||
{"Status", "OK"},
|
||||
{"Thumbprint", HttpContext.Connection.ClientCertificate.Thumbprint},
|
||||
{"Subject", HttpContext.Connection.ClientCertificate.Subject},
|
||||
{"SubjectName", HttpContext.Connection.ClientCertificate.SubjectName.Name},
|
||||
{"Issuer", HttpContext.Connection.ClientCertificate.Issuer},
|
||||
{"IssuerName", HttpContext.Connection.ClientCertificate.IssuerName.Name},
|
||||
{"NotAfter", HttpContext.Connection.ClientCertificate.NotAfter},
|
||||
{"NotBefore", HttpContext.Connection.ClientCertificate.NotBefore}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,12 @@ namespace mvc.Controllers
|
||||
|
||||
Hashtable output = new Hashtable
|
||||
{
|
||||
{"args" , args},
|
||||
{"args", args},
|
||||
{"headers", headers},
|
||||
{"origin" , Request.HttpContext.Connection.RemoteIpAddress.ToString()},
|
||||
{"url" , UriHelper.GetDisplayUrl(Request)},
|
||||
{"query" , Request.QueryString.ToUriComponent()},
|
||||
{"method" , Request.Method}
|
||||
{"origin", Request.HttpContext.Connection.RemoteIpAddress.ToString()},
|
||||
{"url", UriHelper.GetDisplayUrl(Request)},
|
||||
{"query", Request.QueryString.ToUriComponent()},
|
||||
{"method", Request.Method}
|
||||
};
|
||||
|
||||
if (Request.HasFormContentType)
|
||||
@ -45,7 +45,7 @@ namespace mvc.Controllers
|
||||
Hashtable form = new Hashtable();
|
||||
foreach (var key in Request.Form.Keys)
|
||||
{
|
||||
form.Add(key,Request.Form[key]);
|
||||
form.Add(key, Request.Form[key]);
|
||||
}
|
||||
|
||||
output["form"] = form;
|
||||
|
@ -36,7 +36,7 @@ namespace mvc.Controllers
|
||||
if (!Request.HasFormContentType)
|
||||
{
|
||||
Response.StatusCode = 415;
|
||||
Hashtable error = new Hashtable {{"error","Unsupported media type"}};
|
||||
Hashtable error = new Hashtable { { "error", "Unsupported media type" } };
|
||||
return Json(error);
|
||||
}
|
||||
|
||||
@ -54,13 +54,13 @@ namespace mvc.Controllers
|
||||
|
||||
Hashtable fileHash = new Hashtable
|
||||
{
|
||||
{"ContentDisposition" , file.ContentDisposition},
|
||||
{"ContentType" , file.ContentType},
|
||||
{"FileName" , file.FileName},
|
||||
{"Length" , file.Length},
|
||||
{"Name" , file.Name},
|
||||
{"Content" , result},
|
||||
{"Headers" , file.Headers}
|
||||
{"ContentDisposition", file.ContentDisposition},
|
||||
{"ContentType", file.ContentType},
|
||||
{"FileName", file.FileName},
|
||||
{"Length", file.Length},
|
||||
{"Name", file.Name},
|
||||
{"Content", result},
|
||||
{"Headers", file.Headers}
|
||||
};
|
||||
fileList.Add(fileHash);
|
||||
}
|
||||
@ -68,7 +68,7 @@ namespace mvc.Controllers
|
||||
Hashtable itemsHash = new Hashtable();
|
||||
foreach (var key in collection.Keys)
|
||||
{
|
||||
itemsHash.Add(key,collection[key]);
|
||||
itemsHash.Add(key, collection[key]);
|
||||
}
|
||||
|
||||
MediaTypeHeaderValue mediaContentType = MediaTypeHeaderValue.Parse(Request.ContentType);
|
||||
@ -80,10 +80,10 @@ namespace mvc.Controllers
|
||||
|
||||
Hashtable output = new Hashtable
|
||||
{
|
||||
{"Files" , fileList},
|
||||
{"Items" , itemsHash},
|
||||
{"Files", fileList},
|
||||
{"Items", itemsHash},
|
||||
{"Boundary", HeaderUtilities.RemoveQuotes(mediaContentType.Boundary).Value},
|
||||
{"Headers" , headers}
|
||||
{"Headers", headers}
|
||||
};
|
||||
return Json(output);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ namespace mvc.Controllers
|
||||
|
||||
foreach (string entry in GetSingleOrArray<string>(property.Value))
|
||||
{
|
||||
Response.Headers.Append(property.Name,entry);
|
||||
Response.Headers.Append(property.Name, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace mvc.Controllers
|
||||
{
|
||||
public class ResumeController : Controller
|
||||
{
|
||||
private static byte[] FileBytes = new byte[] { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 };
|
||||
private static byte[] FileBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
|
||||
|
||||
public async void Index()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user