PSListModifier.ApplyTo Method

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Updates the specified list by using the current Add, Remove, and Replace lists. The variants of this method can update a collection that is represented by a list or an object. This method is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

NameDescription
System_CAPS_pubmethodApplyTo(IList)

Updates the specified list collection by using the current Add, Remove, and Replace lists. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodApplyTo(Object)

Updates the specified collection object by using the current Add, Remove, and Replace lists. This method is introduced in Windows PowerShell 2.0.

This method updates the specified list in the following manner.

  1. If a Replace lists exists, all elements of the specified list are replaced by the elements of the Replace list.

  2. If a Replace list does not exist, first all elements of the Remove list are removed from the specified list, and then all elements of the Add list are added to the specified list.

Return to top

Community Additions

ADD
Show: