PSReference Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Defines an object that is a value or variable reference in the Windows PowerShell scripting language.

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

System::Object
  System.Management.Automation::PSReference

public ref class PSReference 

NameDescription
System_CAPS_pubmethodPSReference(Object^)

Creates a new PSReference object.

NameDescription
System_CAPS_pubpropertyValue

Gets and sets the value of the reference.

NameDescription
System_CAPS_pubmethodEquals(Object^)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

A reference is created in the following ways.

  • Value Reference

    $a = [ref] 3
    [ref] $a = 3
    [ref] $a = $b
    
  • Variable Reference

    $a = [ref] $b
    

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: