PSVariable Class

Definition

Represents a variable in the PowerShell language.

public ref class PSVariable
public class PSVariable
type PSVariable = class
Public Class PSVariable
Inheritance
PSVariable

Constructors

PSVariable(String)

Constructs a variable with the given name.

PSVariable(String, Object)

Constructs a variable with the given name, and value.

PSVariable(String, Object, ScopedItemOptions)

Constructs a variable with the given name, value, and options.

PSVariable(String, Object, ScopedItemOptions, Collection<Attribute>)

Constructs a variable with the given name, value, options, and attributes.

Properties

Attributes

Gets the collection that contains the attributes for the variable.

Description

Gets or sets the description of the variable.

Module

The module where this variable was defined.

ModuleName

The name of the module that defined this variable.

Name

Gets the name of the variable.

Options

Gets or sets the scope options on the variable.

Value

Gets or sets the value of the variable.

Visibility

If true, then this variable is visible outside the runspace.

Methods

IsValidValue(Object)

Checks if the given value meets the validation attribute constraints on the PSVariable.

Applies to