PowerShell 7.0.3.
When I type Set-Content aaa bbb, the file aaa is created with the content bbb.
When I type Set-Content -NoNewline aaa bbb, the file bbb is created with the content aaa.
It's quite unexpected (especially that it seems that the documentation doesn't mention that).
(Additionally, when I call Set-Content -NoNewline aaa $specificLongText, I get the blue screen of death on my Windows 10 — though I'm not sure whether it's related to PowerShell, it might be that some other software misbehaves when a file with weird name is tried to be created.)
Set-Content -NoNewline aaa bbb
Get-Content aaa,bbb
bbb
Get-Content: Cannot find path 'C:\Test\bbb' because it does not exist.
Get-Content: Cannot find path 'C:\Test\aaa' because it does not exist.
aaa
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This is a parameter binder bug, assign to myself to further investigation/triage.