Compartilhar via


PSObjectPropertyDescriptor.SetValue(Object, Object) Method

Definition

Sets the value of the component to a different value.

public:
 override void SetValue(System::Object ^ component, System::Object ^ value);
public:
 override void SetValue(Platform::Object ^ component, Platform::Object ^ value);
 override void SetValue(winrt::Windows::Foundation::IInspectable const & component, winrt::Windows::Foundation::IInspectable const & value);
public override void SetValue (object component, object value);
override this.SetValue : obj * obj -> unit
Public Overrides Sub SetValue (component As Object, value As Object)

Parameters

component
Object

The component with the property value that is to be set.

value
Object

The new value.

Exceptions

If the property has not been found in the component or an exception has been thrown when setting the value of the property. This Exception will only be thrown if there is no event handler for the SettingValueException 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 SettingValueExceptionEventArgs from its default value of true to false.

If component is null.

If component is not an PSObject or an PSObjectTypeDescriptor.

Applies to