lib/Fs/Pth.ps1
using namespace System.IO using namespace Microsoft.VisualBasic.FileIO function Assert-NoPthSepSfx($s){If(Is-PthSepSfx $s){throw "Given string[$s] cannot have path-sep-sfx[$(Pth-Sep)]"}} function Jn-Seg ($pthSegAy){$ay=(Rmv-EmptyEle $pthSegAy)|%{Rmv-PthSepPfxSfx $_};($ay-join $_pthSep)+$_pthSep} function Split-PthSep($pth) {Rmv-EmptyEle($pth -split '\' + ($_pthSep))} function Brw-Pth ($pth) {$pth=Full-Pth $pth;if(Test-Path $pth) {Shell "explorer ""$pth""" -sty NormalFocus }} function Ens-Pth ($pth) {if(-not(Test-Path $pth)) { $a = md $pth } } function Clr-Pth ($pth) {Clr-PthFil $pth; Clr-PthSubDir $pth} function Clr-PthFil ($pth) {$f = Pth-FfnAy($pth); del $f} function Is-PthSepSfx($s) {Is-Sfx $s $_pthSep} function Is-PthSepPfx($s) {Is-Pfx $s $_pthSep} function Cur-Pth {Ens-PthSfx($pwd.Path)} function Ens-PthSfx($pth) {if(Is-Sfx $pth $_pthSep){$pth}else{$pth+$_pthSep}} function Pth-Sep {$_pthSep } function Rmv-PthSepPfxSfx($pth){Rmv-PfxSfx $pth $_pthSep $_pthSep} $local:_pthSep = [Path]::DirectorySeparatorChar.ToString() |