btw, about ? and % aliases rule says “Avoid aliases, except for –Object cmdlets”.
True; I interpreted that to mean that it was acceptable to drop the “-Object” part and just use “ForEach”, “Where”, “Sort”, “Select”, “Group”, “Compare”, and “Tee”. I still avoid the other aliases for those commands, such as “%”, “?” and “diff”, but maybe those are also considered acceptable according to the community best practices book.
Edit: Regarding the “Primary” thing, that term only had special meaning in the project manager / developer pairings task. Two Primary people should never be paired with each other (which your algorithm handled properly), but I suspect that it should have been possible to allow a non-primary person to be paired twice (which your algorithm did not allow; it automatically promoted the “pair twice” person to primary.) For the secret santa thing, your code works just fine, since the “pair twice” person would wind up being the only Primary anyway.