June 10th, 2015

PowerTip: Use PowerShell to Add Content to File Stream

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to add content to the file system stream of a file.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add data to an alternate NTFS file system stream of a file?

Hey, Scripting Guy! Answer Use the Add-Content cmdlet and specify the name of the stream for the Stream parameter,
           then specify the data in the –Value parameter, for example:

Add-Content C:\fso\AnEmptyFile.txt -Stream Data -Value "datastream"

Note  If the stream does not exist, Windows PowerShell creates it. 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback