Powder room venting into ceiling space?
If it's a half bath (no shower/bathtub), sure, that'd be fine. It's done all the time.

If there's moisture present, you may have to find another way. Recent code (recent in my time frame), technically speaking, forbids it. If you ceiling space is not a wide-open attic, you could make a mold trap by introducing moisture to a dark unvented environment.