OpenMode Enumeration


Updated: April 27, 2016

Applies To: Windows PowerShell

Defines how an item, such as a file, is opened. This class is included in this SDK for completeness only. The members of this class cannot be used directly, nor should this class be used to derive other classes.

Namespace:   Microsoft.PowerShell.Commands
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

public enum OpenMode

Member nameDescription

This opens the file for appending (similar to FileMode.Append)


The file must be created new. If the file exists it is an error (similar to FileMode.CreateNew)


Creates a new file, if the file already exists it is overwritten (similar to FileMode.Create)

Return to top