共用方式為


PSDataCollection<T>.InsertItem(Guid, Int32, T) Method

Definition

Inserts an item into the buffer at a specified index.

protected:
 virtual void InsertItem(Guid psInstanceId, int index, T item);
protected virtual void InsertItem (Guid psInstanceId, int index, T item);
abstract member InsertItem : Guid * int * 'T -> unit
override this.InsertItem : Guid * int * 'T -> unit
Protected Overridable Sub InsertItem (psInstanceId As Guid, index As Integer, item As T)

Parameters

psInstanceId
Guid

InstanceId of PowerShell instance adding this data. Guid.Empty if not initiated by a PowerShell instance.

index
Int32

The zero-based index of the buffer where the object is to be inserted

item
T

The object to be inserted into the buffer.

Exceptions

The index specified is less than zero or greater than Count.

Applies to