I can use Add-LocalGroupMember to add a user to the local group:
Add-LocalGroupMember -Group "Administrators" -Member "foobar"
but it isn't idempotent. If the user already exists then you get this error
Add-LocalGroupMember : foobar is already a member of group Administrators
What is the best way to make this command not error when you want to run this command repeatedly?
The reason is this is part of an Octopus deploy and I don't want to use a prebaked step for something so simple.