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)

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

returnValue = instance.Invoke

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

GenericParameters

T

The .NET Framework 2.0 type of the target type.

Return Value

A strongly-typed enumerator.

Exception typeCondition
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.


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

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft