Adjust style, use $env:userprofile for consistency

This commit is contained in:
Luke Sampson
2017-04-21 08:41:43 +10:00
committed by GitHub
parent 6396fef55e
commit adf0e2cdaf
+1 -2
View File
@@ -87,8 +87,7 @@ function fullpath($path) { # should be ~ rooted
}
function relpath($path) { "$($myinvocation.psscriptroot)\$path" } # relative to calling script
function friendly_path($path) {
$h = $home.ToString()
if(!$h.endswith('\')) { $h += '\' }
$h = "$env:userprofile"; if(!$h.endswith('\')) { $h += '\' }
if($h -eq '\') { return $path }
return "$path" -replace ([regex]::escape($h)), "~\"
}