PowerTip: Use PowerShell to Add Content to File Stream

Doctor Scripto

Dr Scripto

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. 

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment