Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

split a single string by several seperator

$
0
0
Hi,

I have a string from where i want to get the values for my parameters by splitting the string by the seperator -i, -u, -p.

string:
-ic:\reports\inc\ -ucuriosity -psecret

I want to have those values to be assigned to the variables for further use, like:

$i = c:\reports\inc\
$u = curiosity
$p = secret


the split MUST has to be done using the delimiter -i, -u, -p

Viewing all articles
Browse latest Browse all 21975

Trending Articles



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