Convert Windows formatted path to Unix style

你。 提交于 2019-12-19 08:56:34

问题


Suppose you have a path like so:

$myPath = 'C:\Python\27'

Is there a more reliable in PowerShell way of converting that path to Unix format than just replacing the \s like this?

PS C:\> $myPath -replace '\\','/'
C:/Python/27

回答1:


That's the way I would do it, I'm not familiar with any other (built-in) way.



来源:https://stackoverflow.com/questions/17036140/convert-windows-formatted-path-to-unix-style

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!