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.

PSScriptMethod Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Represents a method that runs a script when it is called. These methods are referred to as script methods and are used to extend objects.

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

System.Object
  System.Management.Automation.PSMemberInfo
    System.Management.Automation.PSMethodInfo
      System.Management.Automation.PSScriptMethod

public class PSScriptMethod : PSMethodInfo

NameDescription
System_CAPS_pubmethodPSScriptMethod(String, ScriptBlock)

Initializes a new instance of the PSScriptMethod class that contains the name of the method and the script that is run when the method is called.

NameDescription
System_CAPS_pubpropertyIsInstance

Gets a value that indicates whether the source of the member is a type configuration file.(Inherited from PSMemberInfo.)

System_CAPS_pubpropertyMemberType

Gets an identifier that indicates that this method is a script method.(Overrides PSMemberInfo.MemberType.)

System_CAPS_pubpropertyName

Gets the name of the extended member (method, property, or member set).(Inherited from PSMemberInfo.)

System_CAPS_pubpropertyOverloadDefinitions

Gets the definitions of all of the overloads of the underlying script method.(Overrides PSMethodInfo.OverloadDefinitions.)

System_CAPS_pubpropertyScript

Gets the script that is run when the method is called.

System_CAPS_pubpropertyTypeNameOfValue

Gets the extended type system (ETS) type of this method.(Overrides PSMemberInfo.TypeNameOfValue.)

System_CAPS_pubpropertyValue

Gets and sets the value of this method.(Inherited from PSMethodInfo.)

NameDescription
System_CAPS_pubmethodCopy()

Creates a copy of the current PSScriptMethod object.(Overrides PSMemberInfo.Copy().)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInvoke(Object[])

Invokes the script of the method and retrieves its results.(Overrides PSMethodInfo.Invoke(Object[]).)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodSetMemberName(String)

Sets the name of the extended member. This method is introduced in Windows PowerShell 2.0.(Inherited from PSMemberInfo.)

System_CAPS_pubmethodToString()

Converts the PSScriptMethod object to a string.(Overrides Object.ToString().)

For more information about script methods and other method types that can be used to extend objects, see ETS Methods [ps].

Although it is possible to derive from this class, there is no established scenario for doing this and any attempt to do so may result in unexpected behavior.

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

Return to top
Show: