Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

parse and exclude string from PS command output

$
0
0

Hi guys,

I'm trying to improve my Power-Shell level and i encountered an issues which I'm finding hard to solve.

An output of one of my scripts is as followed:

Path
----
D:\Users\user1
D:\Users\user2
D:\Users\user3
D:\Users\user4
D:\Users\user5

I'm looking for a method to drop the parent folder string ("D:\Users\") in order for my output to look like this:

Path
----
user1

user2

user3

Any suggestions?



Viewing all articles
Browse latest Browse all 2562

Trending Articles



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