while loop read host multiple variable

how do I setup a while loop and prompt user to read 2 variables

while ((($foldername = Read-host "name of folder to create? - Type Q to quit") -ne "Q")

($location = read-host "what is the Datacenter location? - Type Q to Quit) - ne "Q")) {

......

}

July 25th, 2015 8:17pm

What is missing?  What are the rules of a successful entry of variables?

Free Windows Admin Tool Kit Click here and download it now
July 25th, 2015 8:57pm

while((-not $foldername) -or (-not $location){
    $foldername = Read-host 'name of folder to create? - Type Q to quit'
    if($foldername -eq 'q'){exit}
    $location = read-host 'what is the Datacenter location? - Type Q to Quit'
    if($location -eq 'q'){exit}
}

I would start by learning t
July 25th, 2015 9:02pm

thank you

still learning ps very slowly

is it possible to change the script to use params instead?

like

script.ps1 foldername location

how do I put specify the params?

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 12:49pm

help help

help param

July 27th, 2015 1:54pm

... or regarding building Scripts with parameters and starting them:

PS> help script

wizend

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 2:10pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics