MSDN Library

ScriptBlock Members

Represents a precompiled block of script text that can be used as a single unit.

The following tables list the members exposed by the ScriptBlock type.

  Name Description
  ScriptBlock Initializes a new instance of the ScriptBlock class that contains serialization information. Introduced in Windows PowerShell 3.0.x
Top

  Name Description
public property Ast Returns the AST corresponding to the script block. Introduced in Windows PowerShell 3.0.
public property Attributes Gets the attributes of the script block.
public property DebuggerHidden DebuggerHidden. Introduced in Windows PowerShell 4.0.
public property File Gets the file where the script block is defined. This property is introduced in Windows PowerShell 2.0.
public property IsConfiguration Get/set whether this scriptblock is a Configuration. Introduced in Windows PowerShell 4.0.
public property IsFilter Gets or sets a value that indicates whether the script block is a filter.
public property Module Gets information about the module where the script block is defined. This property is introduced in Windows PowerShell 2.0.
public property StartPosition Gets the token that indicates the starting position of the script block.This property is introduced in Windows PowerShell 2.0.
Top

(see also Protected Methods)
 NameDescription
public methodCheckRestrictedLanguageChecks whether the script block uses any language constructs that are not allowed in restricted language mode. Introduced in Windows PowerShell 3.0.
public methodstaticCreateInitializes a new instance of the ScriptBlock class that contains the specified script. This method is introduced in Windows PowerShell 2.0.
public methodEquals  (Inherited from Object)
public methodGetHashCode  (Inherited from Object)
public methodGetNewClosureRetrieves a script block that is bound to a module. This method is introduced in Windows PowerShell 2.0.
public methodGetObjectDataPopulates an object with the data needed to serialize the ScriptBlock. Introduced in Windows PowerShell 3.0.
public methodGetPowerShellOverloaded.  
public methodGetSteppablePipelineOverloaded. Retrieves a pipeline that changes the behavior of its commands. The variants of this method can return a pipeline whose command origin is specified, or a pipeline. This method is introduced in Windows PowerShell 2.0.
public methodGetType  (Inherited from Object)
public methodInvokeInvokes the script block with the specified arguments, returning the results as PSObject objects.
public methodInvokeReturnAsIsRuns the script block with the specified arguments. This method returns the raw (unwrapped) result objects so that it can be more efficient.
public methodInvokeWithContextOverloaded. TBD. Introduced in Windows PowerShell 4.0.
public methodToStringOverridden. Converts the current ScriptBlock object to a string.
Top

(see also Extension Methods)
 NameDescription
protected methodFinalize  (Inherited from Object)
protected methodMemberwiseClone  (Inherited from Object)
Top

  Name Description
public extension method As  Use this method to adapt an object from a foreign app domain to a known interface in this app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method As  This is called to adapt an object from a foreign app domain to a known interface in this appDomainThis element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method As  Adapts an object from a foreign app domain to a known interface in this app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  Use this method to adapt and extend an object so that you can pass it to a foreign app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  This is called to adapt and extend an object that we wish to pass to a foreign app domainThis element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method Extend  Used to extend an object with an interface from a foreign app domain.This element is introduced in Windows PowerShell 5.0. (Defined by RequestExtensions.)
public extension method ToEnumerable  This element is introduced in Windows PowerShell 5.0. (Defined by CollectionExtensions.)
Top


Show:
© 2016 Microsoft