AppendText() | Creates a System.IO.StreamWriter with which text can be appended to a file. |
CopyTo() | Copies a file. |
Create() | Creates a file and returns a System.IO.FileStream object. |
CreateText() | Creates a System.IO.StreamWriter with which a new text file can be written to. |
Encrypt() , Decrypt() | Encrypts/decrypts files for the current account using the cryptographic service provider (CSP) installed on a computer and the encryption keys of the calling process. Only works on NTFS and Windows NT or later. |
Delete() | |
Directory | Returns a System.IO.DirectoryInfo object |
DirectoryName | The string that corresponds to the directory path in which the file is located. |
Exists | |
IsReadOnly | |
Length | The size of the file in bytes. Compare with the Length property of System.IO.FileStream . |
MoveTo() | |
Name | |
Open() | Opens a file and returns a System.IO.FileStream object. |
OpenRead() | |
OpenText() | |
OpenWrite() | |
Replace() | |
ToString() | Returns the file's path as a string. |
PowerShell extension Basename
PowerShell comes with a handy extension: BaseName
:
PS> ([IO.FileInfo] 'p:/ath/to/a/file.txt').Basename
file