首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在PowerShell中将绝对路径转换为相对路径?

如何在PowerShell中将绝对路径转换为相对路径?
EN

Stack Overflow用户
提问于 2012-09-13 04:51:06
回答 6查看 26.1K关注 0票数 39

我想在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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12396025

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档