I have a piece of code whereby someone enters a comma seperated string as a parameter like so:
[string[]] $ipAddressList = "123.113.331.31, 33.33.23.41,22.323.233.14"
foreach($ipAddress in $ipAddressList.Split(",").Trim())
{
Write-Host "1|${ipAddress}|" -NoNewline
}
This is displaying data the exact way I want in this format: 1|123.113.331.31|1|33.33.23.41|1|22.323.233.14| (this is used for an internal program)
How do I assign this value returned to me into a variable as I need to insert it into a configuration file?
Thanks Rob