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
2.1m questions
2.1m answers
60 comments
57.0k users