Here's the one-liner:

([ADSI]"WinNT://$computerName/$localGroupName,group").Add("WinNT://$domainName/$userName");

But a script may be more useful for execution.