I need Powershell 5.1 to resolve(normalize) existing local file path similar to tcl normalize or POSIX realpath
similar to this, this and this.
Say this filename referenced by full path:
D:\temp\multilink\junction-to-other-dir\absolute-symlink-to-other-dir\relative-symlink-to-other-dir\junction_target_dir_contents.txt
should resolve to
D:\exp\junction_target_dir\junction_target_dir_contents.txt
Resolve-Path and [System.IO.Path]::GetFullPath are not resolving symlinks and junctions.
Traversing path up and resolving each folder using (Get-Item $parent_path_part).Target[0]
works but looks cumbersome.
Good old GetFinalPathNameByHandle API does work.
Am I missing any modern(simple) Powershell 5+ way to accomplish this?
EDIT: THIS QUESTION IS NOT 100% DUPLICATE OF powershell to resolve junction target path.
First of all I am looking to resolve multiple junctions and/or symlinks that may be present in the given file path.
Secondly I am looking for nice, simple and possible one-line solution given the improvements of Powershell 5 and 5.1.
That is I am looking for solution ALTERNATE to ones listed in linked questions.