Quantcast
Channel: Hyper-V forum
Viewing all articles
Browse latest Browse all 8743

Split a file path to remove up to first "/"

$
0
0

IS there a way to remove the first part of the URL as follows:

$url = "c:\scripts\test"

So that I just have "test" ?

I've tried replace and also split but nothign seems to work.  So far I have

$newtoplevel = "c:\archive\"
$getDir = get-childitem -recurse -path c:\scripts | ?{ $_.PSIsContainer }
$newtoplevel.count

foreach ($folder in $getdir){
 $folder.fullname

#I need t split here and work with the result

}


Alter De Ruine


Viewing all articles
Browse latest Browse all 8743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>