PSScriptMethod Constructor

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.


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

'Usage
Dim name As String
Dim script As ScriptBlock

Dim instance As New PSScriptMethod(name, script)

public PSScriptMethod (
	string name,
	ScriptBlock script
)
public PSScriptMethod (
	String name, 
	ScriptBlock script
)
public function PSScriptMethod (
	name : String, 
	script : ScriptBlock
)

Parameters

name

The name of the method.

script

The script to be run when the method is called.

Exception typeCondition
ArgumentException

name is null.

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

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.


 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

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