Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private static bool HasBeenSpecified(object obj)

private PSObject _inputObject;
/// <summary>
/// The object to add a member to
/// The object to add a member to.
/// </summary>
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = "MemberSet")]
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = "TypeNameSet")]
Expand All @@ -43,7 +43,7 @@ public PSObject InputObject

private PSMemberTypes _memberType;
/// <summary>
/// The member type of to be added
/// The member type of to be added.
/// </summary>
[Parameter(Mandatory = true, Position = 0, ParameterSetName = "MemberSet")]
[Alias("Type")]
Expand All @@ -55,7 +55,7 @@ public PSMemberTypes MemberType

private string _memberName;
/// <summary>
/// The name of the new member
/// The name of the new member.
/// </summary>
[Parameter(Mandatory = true, Position = 1, ParameterSetName = "MemberSet")]
public string Name
Expand All @@ -66,8 +66,7 @@ public string Name

private object _value1 = s_notSpecified;
/// <summary>
/// First value of the new member. The meaning of this value
/// changes according to the member type.
/// First value of the new member. The meaning of this value changes according to the member type.
/// </summary>
[Parameter(Position = 2, ParameterSetName = "MemberSet")]
public object Value
Expand All @@ -78,8 +77,7 @@ public object Value

private object _value2 = s_notSpecified;
/// <summary>
/// Second value of the new member. The meaning of this value
/// changes according to the member type.
/// Second value of the new member. The meaning of this value changes according to the member type.
/// </summary>
[Parameter(Position = 3, ParameterSetName = "MemberSet")]
public object SecondValue
Expand All @@ -90,7 +88,7 @@ public object SecondValue

private string _typeName;
/// <summary>
/// Add new type name to the specified object for TypeNameSet
/// Add new type name to the specified object for TypeNameSet.
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = "TypeNameSet")]
[Parameter(ParameterSetName = "MemberSet")]
Expand All @@ -105,7 +103,7 @@ public string TypeName

private bool _force;
/// <summary>
/// True if we should overwrite a possibly existing member
/// True if we should overwrite a possibly existing member.
/// </summary>
[Parameter(ParameterSetName = "MemberSet")]
[Parameter(ParameterSetName = NotePropertySingleMemberSet)]
Expand All @@ -117,9 +115,9 @@ public SwitchParameter Force
}

private bool _passThru /* = false */;

/// <summary>
/// Gets or sets the parameter -passThru which states output from
/// the command should be placed in the pipeline.
/// Gets or sets the parameter -passThru which states output from the command should be placed in the pipeline.
/// </summary>
[Parameter(ParameterSetName = "MemberSet")]
[Parameter(ParameterSetName = "TypeNameSet")]
Expand All @@ -138,7 +136,7 @@ public SwitchParameter PassThru

private string _notePropertyName;
/// <summary>
/// The name of the new NoteProperty member
/// The name of the new NoteProperty member.
/// </summary>
[Parameter(Mandatory = true, Position = 0, ParameterSetName = NotePropertySingleMemberSet)]
[ValidateNotePropertyNameAttribute()]
Expand All @@ -152,7 +150,7 @@ public string NotePropertyName

private object _notePropertyValue;
/// <summary>
/// The value of the new NoteProperty member
/// The value of the new NoteProperty member.
/// </summary>
[Parameter(Mandatory = true, Position = 1, ParameterSetName = NotePropertySingleMemberSet)]
[AllowNull]
Expand All @@ -164,8 +162,9 @@ public object NotePropertyValue

// Use IDictionary to support both Hashtable and OrderedHashtable
private IDictionary _property;

/// <summary>
/// The NoteProperty members to be set
/// The NoteProperty members to be set.
/// </summary>
[Parameter(Mandatory = true, Position = 0, ParameterSetName = NotePropertyMultiMemberSet)]
[ValidateNotNullOrEmpty]
Expand Down Expand Up @@ -330,7 +329,7 @@ private PSMemberInfo GetScriptProperty()
}

/// <summary>
/// This method implements the ProcessRecord method for add-member command
/// This method implements the ProcessRecord method for add-member command.
/// </summary>
protected override void ProcessRecord()
{
Expand Down Expand Up @@ -431,7 +430,7 @@ protected override void ProcessRecord()
}

/// <summary>
/// Add the member to the target object
/// Add the member to the target object.
/// </summary>
/// <param name="member"></param>
/// <returns></returns>
Expand Down Expand Up @@ -467,7 +466,7 @@ private bool AddMemberToTarget(PSMemberInfo member)
}

/// <summary>
/// Process the 'NotePropertyMultiMemberSet' parameter set
/// Process the 'NotePropertyMultiMemberSet' parameter set.
/// </summary>
private void ProcessNotePropertyMultiMemberSet()
{
Expand Down Expand Up @@ -526,12 +525,11 @@ private ErrorRecord NewError(string errorId, string resourceId, object targetObj
/// So when given a string or a number that can be converted, we make sure it gets
/// bound to -MemberType, instead of -NotePropertyName.
/// </summary>
///
/// <remarks>
/// This exception will be hidden in the positional binding phase. So we make sure
/// if the argument can be converted to PSMemberTypes, it gets bound to the -MemberType
/// parameter. We are sure that when this exception is thrown, the current positional
/// argument can be successfully bound to
/// argument can be successfully bound to.
/// </remarks>
private sealed class ValidateNotePropertyNameAttribute : ValidateArgumentsAttribute
{
Expand Down Expand Up @@ -561,7 +559,7 @@ protected override void Validate(object arguments, EngineIntrinsics engineIntrin
}

/// <summary>
/// Transform the integer arguments to strings for the parameter NotePropertyName
/// Transform the integer arguments to strings for the parameter NotePropertyName.
/// </summary>
internal sealed class NotePropertyTransformationAttribute : ArgumentTransformationAttribute
{
Expand All @@ -578,4 +576,3 @@ public override object Transform(EngineIntrinsics engineIntrinsics, object input
}
}
}

Loading