Forum Discussion

mfranhind115's avatar
mfranhind115
Brass Contributor
Jul 21, 2022
Solved

how to "parameterize" a for loop cycle

Hi all, weird question it is.   I would like to change the "for each" loop depending on a value got on input.   This is what I'm trying:     $currdomain = Read-Host "Please enter the name of...
  • farismalaeb's avatar
    Jul 21, 2022

    mfranhind115 

    You can try the following

    foreach ($user in (Get-MsolUser -DomainName $currdomain)) {......}

     

Resources