PSObjectPropertyDescriptor.SetValue Method

Definition

Sets the value of the component to a different value.

public override void SetValue (object component, object value);
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.