I'd like to convert a path to a relative path in a PowerShell script. How do I do this using PowerShell?
For example:
Path to convert: c:documentsmynicefilesafile.txt
Reference path: c:documents
Result: mynicefilesafile.txt
And
Path to convert: c:documentsmyproject1afile.txt
Reference path: c:documentsmyproject2
Result: ..myproject1afile.txt
question from:https://stackoverflow.com/questions/12396025/how-to-convert-absolute-path-to-relative-path-in-powershell