Share via


CoreCommandBase.Force Property

Definition

Gets or sets the force property.

public:
 virtual property System::Management::Automation::SwitchParameter Force { System::Management::Automation::SwitchParameter get(); void set(System::Management::Automation::SwitchParameter value); };
public virtual System.Management.Automation.SwitchParameter Force { get; set; }
member this.Force : System.Management.Automation.SwitchParameter with get, set
Public Overridable Property Force As SwitchParameter

Property Value

Remarks

Gives the provider guidance on how vigorous it should be about performing the operation. If true, the provider should do everything possible to perform the operation. If false, the provider should attempt the operation but allow even simple errors to terminate the operation. For example, if the user tries to copy a file to a path that already exists and the destination is read-only, if force is true, the provider should copy over the existing read-only file. If force is false, the provider should write an error.

This is meant to be overridden by derived classes if they support the Force parameter. This property is on the base class to simplify the creation of the CmdletProviderContext.

Applies to