Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Cmdlet.Invoke<T> Method ()

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Invokes a cmdlet object, and returns a strongly-typed enumerator.

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

public IEnumerable<T> Invoke<T>()

Return Value

Type: System.Collections.Generic.IEnumerable<T>

A strongly-typed enumerator.

Type Parameters

T

The .NET Framework 2.0 type of the target type.

Exception Condition
InvalidCastException

An object returned by the cmdlet cannot be converted to the target type.

This method allows you to invoke any cmdlet that derives directly from the Cmdlet class. This method cannot be called to invoke cmdlets that derive from the PSCmdlet class.

Before invoking the cmdlet, set any required and optional (if needed) parameters of the cmdlet.

For more information about cmdlets, see Windows PowerShell Cmdlets.

Return to top

Community Additions

Show: