We are trying to break the following Path from the text file, the path is dynamic in length, i.e, it can be ABC\DSD\AAR\ARE
or ABC\DSD
.
So we need a solution to break down the path as per the following example.
ABC\DSD\AAR
to
ABC$
ABC\\DSD$
ABC\\DSD\\AAR\\*
The Last element should end with \\*
. However all parent elements will end with $
and it should increment until last element is reached and write to file via Out-File module.
May we ask your help to solve this problem through Powershell?
Thank you,
Rokr1