The Update-List cmdlet adds items to and removes items from a property value of an object, and then it returns the
updated object. This cmdlet is designed for properties that contain collections of objects.
The Add and Remove parameters add individual items to and remove them from the collection. The Replace parameter
replaces the entire collection.
If you do not specify a property in the command, Update-List returns an object that describes the update instead
of updating the object. You can submit the update object to cmdlets that change objects, such as Set-* cmdlets.
This cmdlet works only when the property that is being updated supports the IList interface that Update-List uses.
Also, any Set-* cmdlets that accept an update must support the IList interface. The core cmdlets that are
installed with Windows PowerShell do not support this interface. To determine whether a cmdlet supports
Update-List , see the cmdlet Help topic.
PARAMETERS
-Add
Specifies the property values to be added to the collection. Enter the values in the order that they should
appear in the collection.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-InputObject
Specifies the objects to be updated. You can also pipe the object to be updated to Update-List .
Required? false
Position? named
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Property
Specifies the property that contains the collection that is being updated. If you omit this parameter,
Update-List returns an object that represents the change instead of changing the object.
Specifies the property values to be removed from the collection.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Replace
Specifies a new collection. This parameter replaces all items in the original collection with the items
specified by this parameter.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.Management.Automation.PSObject
You can pipe the objects to be updated to Update-List .
OUTPUTS
Objects or System.Management.Automation.PSListModifier
Update-List returns the updated object, or it returns an object that represents the update action.
NOTES
Example 1: Add and remove items from a property value