-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.
Description
When I tried to read a file using a pipeline, edit the contents, and save it, I got unexpected behavior.
Is this correct behavior by design ?
# Create a text file for testing
PS> 'A' | Out-File -FilePath C:\test.txt
# Read file , modified, overwrite
PS> Get-Content -Path C:\test.txt -Raw | ForEach-Object {$_ + 'B'} | Out-File -FilePath C:\test.txt
# I expect that the output is 'AB', but it outputs nothing
PS> Get-Content -Path C:\test.txt -Raw
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.