PowerShell スクリプトでパスを相対パスに変換したいと考えています。PowerShell を使用してこれを行うにはどうすればよいですか?
例えば:
Path to convert: c:\documents\mynicefiles\afile.txt
Reference path: c:\documents
Result: mynicefiles\afile.txt
と
Path to convert: c:\documents\myproject1\afile.txt
Reference path: c:\documents\myproject2
Result: ..\myproject1\afile.txt