【发布时间】:2012-09-12 20:51:06
【问题描述】:
我想在 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
【问题讨论】:
标签: powershell