hi
you need the IDs of the target groups, with this code you have all you Need (Computer Name must be the FullDomainName !):
# get server
$server = Get-WsusServer -Name '<ServerName>' -PortNumber 8530
# list all TargetGroups with ID
$server.GetComputerTargetGroups() | ft Name, Id
# get computer
$computer = $server.GetComputerTargetByName('<full.name>')
# add to group (you need the ID from the list above)
$newGroup = $server.GetComputerTargetGroup('7ef0a609-9ac7-437f-bdf9-bd5a15c91dfa')
$newGroup.AddComputerTarget($computer)
# remove from group (you need the ID from the list above)
$oldGroup = $server.GetComputerTargetGroup('7ef0a609-9ac7-437f-bdf9-bd5a15c91dfa')
$oldGroup.RemoveComputerTarget($computer)