Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Update-List

Update-List - Powershell 2.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.

Update-List


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

Syntax
Update-List [-Add <Object[]>] [-Remove <Object[]>] [[-Property] <string>] [-InputObject <psobject>] [<CommonParamet
ers>]

Update-List -Replace <Object[]> [[-Property] <string>] [-InputObject <psobject>] [<CommonParameters>]

Description
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 re
places 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.