// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using Microsoft.PowerShell.LocalAccounts; namespace Microsoft.PowerShell.Commands { /// /// Describes a Local Group. /// Objects of this type are provided to and returned from group-related Cmdlets. /// public class LocalGroup : LocalPrincipal { #region Public Properties /// /// A short description of the Group. /// public string Description { get; set; } #endregion Public Properties #region Construction /// /// Initializes a new LocalGroup object. /// public LocalGroup() { ObjectClass = Strings.ObjectClassGroup; } /// /// Initializes a new LocalUser object with the specified name. /// /// Name of the new LocalGroup. public LocalGroup(string name) : base(name) { ObjectClass = Strings.ObjectClassGroup; } /// /// Construct a new LocalGroup object that is a copy of another. /// /// private LocalGroup(LocalGroup other) : this(other.Name) { Description = other.Description; } #endregion Construction #region Public Methods /// /// Provides a string representation of the LocalGroup object. /// /// /// A string containing the Group Name. /// public override string ToString() { return Name ?? SID.ToString(); } /// /// Create a copy of a LocalGroup object. /// /// /// A new LocalGroup object with the same property values as this one. /// public LocalGroup Clone() { return new LocalGroup(this); } #endregion Public Methods } }