Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Update-List

Update-List - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Adds items to and removes items from a property value that contains a collection of objects.

Update-List [[-Property] <String>] [-Add <Object[]>] [-InputObject <PSObject>] [-Remove <Object[]>] [<CommonParameters>
Update-List [[-Property] <String>] [-InputObject <PSObject>] -Replace <Object[]> [<CommonParameters>]

The Update-List cmdlet adds items to and removes items from a property value of an object, and then it returns the upda
ted 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 replac
es the entire collection.

If you do not specify a property in the command, Update-List returns an object that describes the update instead of upd
ating 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 Wi
ndows PowerShell do not support this interface. To determine whether a cmdlet supports Update-List, see the cmdlet Help