I need to join two paths, each of those can be absolute. In such a case the second path should win, if both are. But the Join-Path commandlet doesn't seem to produce the desired result:
> Join-Path 'path' 'C:\Windows'
path\C:\Windows
The result produced is invalid as long as the 2d path is absolute no matter what I tried, quite surprisingly for me, because I guess I'm too used to path joining facilities in other languages where this would result in C:\Windows.
How can I solve this? I use Powershell Core v7.1.