Actually, you can, it just takes a little doing - you were on the right track. Unfortunately it means not using the default parameter sets that do things like hashing the password for you and building the objects as required. Also, turns out I need to update some of my code to allow for it in a better way (see after).
To get you started, here is code that works (I've only not tested the password).
$O = New-GAUserOrganizationObj -CostCenter "NewcostCenter" -Department "This their dept" -Location "SomewhereOutThere"
$N = New-GAUserNameObj -FamilyName "Smith" -GivenName "Bob"
$P = "ThisIsPasswordInPlainText"
New-GAUser -UserBody $B -UserName "ignorethis"
First off,
see here to see what fields Google requires in a new account - basically first and last name, password and primary email. Everything else can be added, as long as the required fields are provided. Here I build out the organization object first, then the name object, then the password, and finally add it all in to the body object.
Note: This will send your password via plain-text. If you want to hash it, you'll need to hash the password string and then specify the hash function in the proper $B.hashfunction or using -HashFunction when you build the body. GShell uses the md5 hash by default when you are using the other parameter sets, so if you'd like me to link to the relevant part of the C# code for that let me know. Otherwise Google is your friend, for now.
As I mentioned, my code is a little not great. That's because the -UserName is required for new-gauser no matter what, but if you specify the -Body param it isn't used. I'll have to fix that. At the very least, could you
add a new issue for that and we can start working on getting it fixed.
Down the line we can discuss how better to allow users to include a body while also using things like the built-in password hashing.
Hope that helps!
Cheers,
Spencer