From 871ebe1b3dd8c208f005a083c2dd86d80a41b0c6 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sat, 18 Oct 2025 16:25:08 +0100 Subject: [PATCH] Fix SA1003: Symbols should be spaced correctly --- .../LocalAccounts/Extensions.cs | 15 ++++++++------- .../LocalAccounts/Sam.cs | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs index 007966cb0a8..6b2b84ed371 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs @@ -107,7 +107,7 @@ internal static UInt32 GetRid(this SecurityIdentifier sid) byte[] sidBinary = new byte[sid.BinaryLength]; sid.GetBinaryForm(sidBinary, 0); - return System.BitConverter.ToUInt32(sidBinary, sidBinary.Length-4); + return System.BitConverter.ToUInt32(sidBinary, sidBinary.Length - 4); } /// @@ -130,12 +130,13 @@ internal static long GetIdentifierAuthority(this SecurityIdentifier sid) // The Identifier Authority is six bytes wide, // in big-endian format, starting at the third byte - long authority = (long) (((long)sidBinary[2]) << 40) + - (((long)sidBinary[3]) << 32) + - (((long)sidBinary[4]) << 24) + - (((long)sidBinary[5]) << 16) + - (((long)sidBinary[6]) << 8) + - (((long)sidBinary[7]) ); + long authority = + (((long)sidBinary[2]) << 40) + + (((long)sidBinary[3]) << 32) + + (((long)sidBinary[4]) << 24) + + (((long)sidBinary[5]) << 16) + + (((long)sidBinary[6]) << 8) + + (((long)sidBinary[7])); return authority; } diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs index 3e6bbcafd10..ad90181c660 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs @@ -1247,7 +1247,7 @@ private LocalUser CreateUser(LocalUser userInfo, System.Security.SecureString pa status = SamApi.SamCreateUser2InDomain(domainHandle, ref str, - (int) SamApi.USER_NORMAL_ACCOUNT, + (int)SamApi.USER_NORMAL_ACCOUNT, Win32.MAXIMUM_ALLOWED, out userHandle, out grantedAccess, @@ -1473,7 +1473,7 @@ private IEnumerable GetGroupMembers(SecurityIdentifier groupSid) Marshal.Copy(memberIds, idArray, 0, (int)memberCount); - for (int i=0; i < memberCount; i++) + for (int i = 0; i < memberCount; i++) { var sid = new SecurityIdentifier(idArray[i]); yield return MakeLocalPrincipalObject(LookupAccountInfo(sid));