Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SessionStateFunctionEntry Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Defines a function for an initial session state configuration. The initial session state of a runspace defines the elements, such as functions, that are available when the runspace is opened. This class cannot be inherited. This class is introduced in Windows PowerShell 2.0.

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


public sealed class SessionStateFunctionEntry : SessionStateCommandEntry

NameDescription
System_CAPS_pubmethodSessionStateFunctionEntry(String, String)

Initializes a new instance of the SessionStateFunctionEntry class that contains the name and definition of the function. This constructor is introduced by Windows PowerShell 2.0.

System_CAPS_pubmethodSessionStateFunctionEntry(String, String, ScopedItemOptions, String)

Initializes a new instance of the SessionStateFunctionEntry class that contains the function name, the function definition, the usage options of the function, and the name of the help file. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodSessionStateFunctionEntry(String, String, String)

Initializes a new instance of the SessionStateFunctionEntry class that contains the function name, the function definition, and the name of the help file. Introduced in Windows PowerShell 3.0.

NameDescription
System_CAPS_pubpropertyCommandType

Gets the type of the command entry, such as a cmdlet, script, or function. This property is introduced in Windows PowerShell 2.0.(Inherited from SessionStateCommandEntry.)

System_CAPS_pubpropertyDefinition

Gets the name of the function for this entry. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyHelpFile

Gets the name of the help file associated with the function. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyModule

Gets information about the module defined by this session state entry. This property is introduced in Windows PowerShell 2.0.(Inherited from InitialSessionStateEntry.)

System_CAPS_pubpropertyName

Gets the name of the entry for the derived class. This property is introduced in Windows PowerShell 2.0.(Inherited from InitialSessionStateEntry.)

System_CAPS_pubpropertyOptions

Gets the usage options for the function of this entry. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyPSSnapIn

Gets information about the snap-in defined by the session state entry. This property is introduced in Windows PowerShell 2.0.(Inherited from InitialSessionStateEntry.)

System_CAPS_pubpropertyVisibility

Gets and sets a Boolean value that indicates whether the session state entry is public or private. This property is introduced in Windows PowerShell 2.0.(Inherited from ConstrainedSessionStateEntry.)

NameDescription
System_CAPS_pubmethodClone()

Creates an exact copy of the current SessionStateFunctionEntry object. This method is introduced in Windows PowerShell 2.0.(Overrides InitialSessionStateEntry.Clone().)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

The function entry is added to the initial session state through the Commands property of the InitialSessionState object.

This example defines a function entry using the name a definition of the function.

new SessionStateFunctionEntry("mkdir",
    "param($paths); New-Item -type directory -path $paths"),

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
Show: