首页 > 其他 > 详细

取出根路径

时间:2014-08-21 16:31:24      阅读:310      评论:0      收藏:0      [点我收藏+]

 

1 $text = "\\127.0.0.1\D$\Hotfix\Hotfix_Win2003\2014-04"
2 $pathRoot = [System.IO.Path]::GetPathRoot($text)
3 $driverLetter = $pathRoot[-2]
4 Join-Path ("$driverLetter" + ":") $text.Substring($pathRoot.Length, $text.Length - $pathRoot.Length)

$pathRoot的返回值为:\\127.0.0.1\D$

 

判断路径:

test-path "filesystem::\\127.0.0.1\d$"

取出根路径,布布扣,bubuko.com

取出根路径

原文:http://www.cnblogs.com/dreamer-fish/p/3927153.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!