Cmdlet.Invoke Method ()

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

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

Dim instance As Cmdlet
Dim returnValue As IEnumerable(Of T)

returnValue = instance.Invoke

Public Function Invoke(Of T) As IEnumerable(Of T)



The .NET Framework 2.0 type of the target type.

Return Value

A strongly-typed enumerator.

Exception typeCondition

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Target Platforms

© 2014 Microsoft