There are a few options for writing data to
files:
By using the > redirection operator:
get-childitem > c:\[Link]
By using the New-Item cmdlet to create an
empty file:
new-item c:\[Link] -type file
The Set-Content cmdlet will overwrite and
replace data already in the file:
Set-Content C:\[Link] "It was the worst of
times...
Set-Content C:\[Link] "It was the best of
times...
The Add-Content cmdlet will append data to a file:
Add-Content C:\[Link] "It was the worst of
times...
We can pipe data to the Out-File cmdlet (this will
overwrite an existing file):
gci | Out-File c:\[Link]
Use Get-Content cmdlet to read data from a file:
Get-Content C:\[Link]