Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Windows格式的路径转换为Unix样式_Unix_Powershell_Path - Fatal编程技术网

将Windows格式的路径转换为Unix样式

将Windows格式的路径转换为Unix样式,unix,powershell,path,Unix,Powershell,Path,假设您有这样一条路径: $myPath = 'C:\Python\27' 有没有一种在PowerShell中更可靠的方法将该路径转换为Unix格式,而不仅仅是像这样替换\s PS C:\> $myPath -replace '\\','/' C:/Python/27 我会这样做,我不熟悉任何其他(内置)方式

假设您有这样一条路径:

$myPath = 'C:\Python\27'
有没有一种在PowerShell中更可靠的方法将该路径转换为Unix格式,而不仅仅是像这样替换
\
s

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

我会这样做,我不熟悉任何其他(内置)方式