I have two paths:
fred\frog
and
..\frag
I can join them together in PowerShell like this:
join-path 'fred\frog' '..\frag'
That gives me this:
fred\frog\..\frag
But I don't want that. I want a normalized path without the double dots, like this:
fred\frag
How can I get that?
You can expand ..\frag to its full path with resolve-path:
PS > resolve-path ..\frag
Try to normalize the path using the combine() method:
[io.path]::Combine("fred\frog",(resolve-path ..\frag).path)