Compartilhar via


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 ref class PSListModifier
public class PSListModifier
type PSListModifier = class
Public Class PSListModifier
Inheritance
PSListModifier
Derived

Constructors

PSListModifier()

Create a new PSListModifier with empty lists for Add/Remove.

PSListModifier(Collection<Object>, Collection<Object>)

Create a new PSListModifier with the specified add and remove lists.

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.

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.

Applies to