GSF.Identity.UserInfo.RemoveLocalGroup C# (CSharp) Method

RemoveLocalGroup() public static method

Removes local group if it exists.
was null. No was specified. Could not remove local group.
public static RemoveLocalGroup ( string groupName ) : bool
groupName string Group name to remove if it exists.
return bool
        public static bool RemoveLocalGroup(string groupName)
        {
            if ((object)groupName == null)
                throw new ArgumentNullException(nameof(groupName));

            // Remove any irrelevant white space
            groupName = groupName.Trim();

            if (groupName.Length == 0)
                throw new ArgumentException("Cannot remove local group: no group name was specified.", nameof(groupName));

            groupName = ValidateGroupName(groupName);

            if (Common.IsPosixEnvironment)
                return UnixUserInfo.RemoveLocalGroup(groupName);

            return WindowsUserInfo.RemoveLocalGroup(groupName);
        }