PowerTip: Read NTFS File System Stream with PowerShell

Summary: Use Windows PowerShell to read a specific NTFS file system stream.

Hey, Scripting Guy! Question How can I use Windows PowerShell to read a specific NTFS file system stream?

Hey, Scripting Guy! Answer Use the Get-Content cmdlet and specify the name of the file and the name of the stream.
           This example reads a stream named Data:

Get-Content C:\fso\AnEmptyFile.txt -Stream data

Comments (3)

  1. Brian Ehlert says:

    Back when I was an IT Pro, I had no idea what a file system stream even was. Why it mattered, or when it is relevant.
    It is great that it is possible. But to someone whom is not a developer; Why? Why does it matter, why do I care, how it is relevant to IT Pro or Operations tasks?

  2. Gets the contents of the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are not supported.
    Stream is a dynamic parameter that the FileSystem provider adds to the Get-Content cmdlet. This parameter works only in file system drives.

  3. Greg Wojan says:

    If I remember correctly, alternate data streams were added back in Windows NT 3.1 for compatibility with the MacOS file system at the time.

    Alternate streams aren’t used too much that I know of with the exception of IE which hides a Zone.Identifier for files downloaded from the Internet. There are a few other programs out there that utilize ADS but they’re only supported on NTFS so you lose the
    stream if you copy a file to a non-NTFS disk. 🙁

Skip to main content