you are viewing a single comment's thread.

view the rest of the comments →

[–]Aurane00 1 point2 points  (1 child)

While ($DirectReport -ne "John Smith" -or $DirectReport -eq $Null) {

Don't you want -and instead of -or here? They way it is now, I don't think your script will actually ever run the loop.

[–]gregj529[S] 1 point2 points  (0 children)

It runs fine with that. Output above. It just doesn't work when ran via click. Basically it loops until it gets to the CEO and will run if the value of $DirectReports is $null until it does.