Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Only loops once

$
0
0

$NU = {
}
&$NU
$NewUser = read-host "Add another user?"
if ($NewUser -eq "Y") {&$NU}

Trying to keep the loop going until I say "No" but it only seems to loop once before it just stops..

I'm running a simple new-aduser command with some pre-populated variables (Variables that set first name, last name, displayname) that define $NU

AM I missing something that only allows this to loop once?

Thanks!


Jason Ostrowski


Viewing all articles
Browse latest Browse all 15028


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