Share via


PSObjectPropertyDescriptor.GetValue(Object) Method

Definition

Gets the current value of the property on a component.

public:
 override System::Object ^ GetValue(System::Object ^ component);
public:
 override Platform::Object ^ GetValue(Platform::Object ^ component);
 override winrt::Windows::Foundation::IInspectable GetValue(winrt::Windows::Foundation::IInspectable const & component);
public override object GetValue (object component);
override this.GetValue : obj -> obj
Public Overrides Function GetValue (component As Object) As Object

Parameters

component
Object

The component with the property for which to retrieve the value.

Returns

The value of a property for a given component.

Exceptions

If the property has not been found in the component or an exception has been thrown when getting the value of the property. This Exception will only be thrown if there is no event handler for the GettingValueException event of the PSObjectTypeDescriptor that created this PSObjectPropertyDescriptor. If there is an event handler, it can prevent this exception from being thrown, by changing the ShouldThrow property of GettingValueExceptionEventArgs from its default value of true to false.

If component is null.

If component is not an PSObject or an PSObjectTypeDescriptor.

Applies to