ScriptRequiresException Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

The exception that is thrown when a script cannot run because the requirements that are specified by the script's #requires statements are not met.

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

System::Object
  System::Exception
    System::SystemException
      System.Management.Automation::RuntimeException
        System.Management.Automation::ScriptRequiresException

[SerializableAttribute]
public ref class ScriptRequiresException : RuntimeException

NameDescription
System_CAPS_pubmethodScriptRequiresException()

Initializes a new instance of the ScriptRequiresException class that is empty.

System_CAPS_protmethodScriptRequiresException(SerializationInfo^, StreamingContext)

Initializes a new instance of the ScriptRequiresException class that contains information that is read from the provided serialization information.

System_CAPS_pubmethodScriptRequiresException(String^)

Initializes a new instance of the ScriptRequiresException class that contains an exception message.

System_CAPS_pubmethodScriptRequiresException(String^, Exception^)

Initializes a new instance of the ScriptRequiresException class that contains an exception message and the inner exception that caused this exception to be thrown.

NameDescription
System_CAPS_pubpropertyCommandName

Gets the name of the command that contains the #requires statement.

System_CAPS_pubpropertyData

(Inherited from Exception.)

System_CAPS_pubpropertyErrorRecord

Gets the error record associated with the exception.(Inherited from RuntimeException.)

System_CAPS_pubpropertyHelpLink

(Inherited from Exception.)

System_CAPS_pubpropertyHResult

(Inherited from Exception.)

System_CAPS_pubpropertyInnerException

(Inherited from Exception.)

System_CAPS_pubpropertyMessage

(Inherited from Exception.)

System_CAPS_pubpropertyMissingPSSnapIns

Gets the names of the missing snap-ins based on the #requires statement.

System_CAPS_pubpropertyRequiresPSVersion

Gets the Windows PowerShell version that the script requires.

System_CAPS_pubpropertyRequiresShellId

Gets the identifier of the required shell as specified in the #requires statement.

System_CAPS_pubpropertyRequiresShellPath

Gets the path to the shell specified in the #requires statement.

System_CAPS_pubpropertySource

(Inherited from Exception.)

System_CAPS_pubpropertyStackTrace

(Inherited from Exception.)

System_CAPS_pubpropertyTargetSite

(Inherited from Exception.)

System_CAPS_pubpropertyWasThrownFromThrowStatement

Gets or sets a value that indicates whether the exception was thrown from a throw statement.(Inherited from RuntimeException.)

NameDescription
System_CAPS_pubmethodEquals(Object^)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetBaseException()

(Inherited from Exception.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetObjectData(SerializationInfo^, StreamingContext)

Provides serialization functionality for the ISerializable interface.(Overrides RuntimeException::GetObjectData(SerializationInfo^, StreamingContext).)

System_CAPS_pubmethodGetType()

(Inherited from Exception.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Exception.)

NameDescription
System_CAPS_proteventSerializeObjectState

(Inherited from Exception.)

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

Community Additions

ADD
Show: