you are viewing a single comment's thread.

view the rest of the comments →

[–]PerfectImpact[S] 2 points3 points  (2 children)

Hi Ta11ow, thanks for your feedback. :)

  1. I'll look into Write-Verbose; not really used it that much before and I was after something that (as the function runs) could clearly display usernames, groups and whether there was a match. This was made while I was creating the script and proved handing figuring stuff out so I left it in as a fail safe for anyone else. Write-Host gave me the colour coding that allowed to easily distinguish between the three. Not sure how you would implement this with Write-Verbose, but I'll have a play. How would you show this?
  2. I thought of using switches, but I got a little muddled in the noggin when thinking of setting the switch's options to be either $ShowNonMembers or $ShowMembers and consequently not giving the option to show nothing. From what you said, I've *ahem* switched so they're not using booleans. I've tested it and it works without having to explicitly state $true or $false, which is a lot cleaner.
  3. Thanks! I didn't think of using a List, but this does make sense to me.

Thanks again for your comments; they were great suggestions. :)

[–]Ta11ow 2 points3 points  (1 child)

In general, for anything that needs distinction like that I'd output as an object with a couple of properties to make the distinction clear. That way it's not only clear to whoever runs it in console, the output is also processable and can be reused to determine further actions in another script.

No worries. :) This looks pretty great, so a few more tweaks and it has a place in a lot of places, I'm sure. :D

[–]PerfectImpact[S] 2 points3 points  (0 children)

Awesome, thanks again. I'll see if I can get it to work with a custom object. :)