PSScriptMethod Constructor (String, ScriptBlock)
Updated: April 27, 2016
Applies To: Windows PowerShell
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.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
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.