Partilhar via


ScriptCallDepthException Class

Definition

ScriptCallDepthException occurs when the number of session state objects of this type in this scope exceeds the configured maximum.

public ref class ScriptCallDepthException : SystemException, System::Management::Automation::IContainsErrorRecord
[System.Serializable]
public class ScriptCallDepthException : SystemException, System.Management.Automation.IContainsErrorRecord
public class ScriptCallDepthException : SystemException, System.Management.Automation.IContainsErrorRecord
[<System.Serializable>]
type ScriptCallDepthException = class
    inherit SystemException
    interface IContainsErrorRecord
type ScriptCallDepthException = class
    inherit SystemException
    interface IContainsErrorRecord
Public Class ScriptCallDepthException
Inherits SystemException
Implements IContainsErrorRecord
Inheritance
ScriptCallDepthException
Attributes
Implements

Remarks

When one PowerShell command or script calls another, this creates an additional scope. Some script expressions also create a scope. PowerShell imposes a maximum call depth to prevent stack overflows. The maximum call depth is configurable but generally high enough that scripts which are not deeply recursive should not have a problem.

Constructors

ScriptCallDepthException()

Instantiates a new instance of the ScriptCallDepthException class.

ScriptCallDepthException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the ScriptCallDepthException class using data serialized via ISerializable

ScriptCallDepthException(String, Exception)

Instantiates a new instance of the ScriptCallDepthException class.

ScriptCallDepthException(String)

Instantiates a new instance of the ScriptCallDepthException class.

Properties

CallDepth

Always 0 - depth is not tracked as there is no hard coded maximum.

ErrorRecord

See IContainsErrorRecord

Methods

GetObjectData(SerializationInfo, StreamingContext)

Serializer for ISerializable

Applies to