From 2ff151940f1bd7cfb32eceae6787215c0483126c Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Thu, 12 Nov 2020 22:58:17 +0000 Subject: [PATCH 1/4] Sorting usings --- .../security/AclCommands.cs | 14 +++++------ .../security/CatalogCommands.cs | 8 +++---- .../security/CertificateProvider.cs | 24 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 7fa42b31424..302ca9d4937 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -5,18 +5,18 @@ #pragma warning disable 56506 using System; -using System.Management.Automation; -using Dbg = System.Management.Automation; -using System.Management.Automation.Security; -using System.Security.AccessControl; -using System.Security.Principal; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; using System.Globalization; -using System.ComponentModel; +using System.Management.Automation; +using System.Management.Automation.Security; using System.Reflection; +using System.Runtime.InteropServices; +using System.Security.AccessControl; +using System.Security.Principal; +using Dbg = System.Management.Automation; namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index 895a551e057..75e9f3747d3 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -4,14 +4,14 @@ #if !UNIX using System; -using System.Management.Automation; -using Dbg = System.Management.Automation.Diagnostics; using System.Collections; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Management.Automation; using System.Management.Automation.Provider; using System.Runtime.InteropServices; -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; +using Dbg = System.Management.Automation.Diagnostics; namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index e60b817d4ec..7c9869b9359 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -4,28 +4,28 @@ #if !UNIX using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.IO; using System.Management.Automation; using System.Management.Automation.Host; using System.Management.Automation.Internal; -using Runspaces = System.Management.Automation.Runspaces; -using Dbg = System.Management.Automation; -using Security = System.Management.Automation.Security; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections; -using System.Runtime.InteropServices; using System.Management.Automation.Provider; +using System.Runtime.InteropServices; +using System.Security; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text.RegularExpressions; -using System.Globalization; -using System.IO; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Xml; using System.Xml.XPath; -using System.Security; +using Dbg = System.Management.Automation; using DWORD = System.UInt32; +using Runspaces = System.Management.Automation.Runspaces; +using Security = System.Management.Automation.Security; namespace Microsoft.PowerShell.Commands { From 5223259a9bfd138435af9ed8865aa71fa4d66a35 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Thu, 12 Nov 2020 23:01:32 +0000 Subject: [PATCH 2/4] Fix IDE0005: Remove unnecessary import src\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.csproj https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005 --- src/Microsoft.PowerShell.Security/security/AclCommands.cs | 1 - .../security/CatalogCommands.cs | 4 ---- .../security/CertificateCommands.cs | 3 --- .../security/SecureStringCommands.cs | 2 -- .../security/SignatureCommands.cs | 7 ------- 5 files changed, 17 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 302ca9d4937..6ecb94b42cd 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -12,7 +12,6 @@ using System.Globalization; using System.Management.Automation; using System.Management.Automation.Security; -using System.Reflection; using System.Runtime.InteropServices; using System.Security.AccessControl; using System.Security.Principal; diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index 75e9f3747d3..5b542da92c2 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -4,13 +4,9 @@ #if !UNIX using System; -using System.Collections; using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Management.Automation; -using System.Management.Automation.Provider; -using System.Runtime.InteropServices; using Dbg = System.Management.Automation.Diagnostics; namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs index 0da1112f5e3..46ab49ee0ab 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs @@ -1,11 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Management.Automation; using System.Security; using System.Security.Cryptography; diff --git a/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs b/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs index 36316364c82..6333541e242 100644 --- a/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs @@ -2,8 +2,6 @@ // Licensed under the MIT License. using System; -using System.Globalization; -using System.IO; using System.Management.Automation; using System.Runtime.InteropServices; using System.Security; diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index 3fa7c054a20..49a37d06c78 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -2,22 +2,15 @@ // Licensed under the MIT License. using System; -using System.Collections; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Management.Automation; using System.Management.Automation.Internal; -using System.Management.Automation.Provider; -using System.Runtime.InteropServices; -using System.Security; using System.Security.Cryptography.X509Certificates; using Dbg = System.Management.Automation.Diagnostics; -using DWORD = System.UInt32; - namespace Microsoft.PowerShell.Commands { /// From f3d589fa753c701329fa3d696e33da5a0cc0a948 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 19 Nov 2020 11:49:15 +0000 Subject: [PATCH 3/4] Update src/Microsoft.PowerShell.Security/security/AclCommands.cs Co-authored-by: Ilya --- src/Microsoft.PowerShell.Security/security/AclCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 6ecb94b42cd..6f90fefe1ef 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -15,6 +15,7 @@ using System.Runtime.InteropServices; using System.Security.AccessControl; using System.Security.Principal; + using Dbg = System.Management.Automation; namespace Microsoft.PowerShell.Commands @@ -1587,4 +1588,3 @@ protected override void ProcessRecord() } #pragma warning restore 56506 - From 641b217d5389c0f33e7163ab694a25f5c6065133 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 19 Nov 2020 19:54:34 +0500 Subject: [PATCH 4/4] Update src/Microsoft.PowerShell.Security/security/CertificateProvider.cs --- .../security/CertificateProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 7c9869b9359..54255c9154f 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -22,6 +22,7 @@ using System.Text.RegularExpressions; using System.Xml; using System.Xml.XPath; + using Dbg = System.Management.Automation; using DWORD = System.UInt32; using Runspaces = System.Management.Automation.Runspaces;