PSListModifier
Class
Definition
PSListModifier is a simple helper class created by the update-list cmdlet. The update-list cmdlet will either return an instance of this class, or it will internally use an instance of this class to implement the updates.
Cmdlets can also take a PSListModifier as a parameter. Usage might look like:
Get-Mailbox | Set-Mailbox -Alias @{Add='jim'}
Alias would take a PSListModifier and the Cmdlet code would be responsible
for apply updates (possibly using PSListModifier.ApplyTo or else using custom logic).
public class PSListModifier
- Inheritance
-
PSListModifier
- Derived
Constructors
| PSListModifier() |
Create a new PSListModifier with empty lists for Add/Remove. |
| PSListModifier(Hashtable) |
Create a new PSListModifier with the specified add and remove lists (in the hash.) |
| PSListModifier(Object) |
Create a new PSListModifier to replace a given list with replaceItems. |
| PSListModifier(Collection<Object>, Collection<Object>) |
Create a new PSListModifier with the specified add and remove lists. |
Properties
| Add |
The list of items to add when ApplyTo is called. |
| Remove |
The list of items to remove when AppyTo is called. |
| Replace |
The list of items to replace an existing list with. |
Methods
| ApplyTo(IList) |
Update the given collection with the items in Add and Remove. |
| ApplyTo(Object) |
Update the given collection with the items in Add and Remove. |