ValueFromPipeline taking precedence over ValueFromPipelineByPropertyName
When a cmdlet has a -value parameter that accepts pipeline data both ByValue and ByPropertyName it always takes it by value. I have seen this in both Set-Variable and Set-Content using PowerShell v5.
For example, consider the following code:
[PSCustomObject]@{
'Path' = 'C:\Temp\MyFile.txt'
'Value' = 'PowerShell is fun!'
} | Set-Content
The above does create the file C:\Temp\MyFile.txt (assuming the directory path exists), but the content is not what I would expect. What I would expect is that the file contain the text 'PowerShell is fun!' and nothing else. What it instead contains is a hashtable representing the entire object:
@{'Path' = 'C:\Temp\MyFile.txt';'Value' = 'PowerShell is fun!'}
I think a better way of handling this would be to have ValueFromPipelineByPropertyName take precedence over ValueFromPipeline.
