I have the following array:
$webApplications = Get-SPWebApplication | Select-Object Url
which gives output similar to this:
http://testportal.*******de http://testportal2.******de
I would like the output to be numbered like this for example:
1- http://testportal.*******de 2- http://testportal2.******de
and then store them in variables and have the user be able to choose the portal they want by typing in only the number of the portal. I tried something like this to store them in variables (not sure if it's the right approach):
$Variable1 = $webApplications[0]
$Variable2 = $webApplications[1]
$SelectedURL = Read-Host 'choose your portal by selecting a number'
I just can't seem to figure out how to list the content of the array with numbers on the side and then call it back for the $SelectedURL variable.