In the API, deleting the agent and deleting the associated node are two separate operations. The agent management UI combines them.
Your PowerShell for deleting the agent looks correct. You can also do it by getting the Uri for the agent record and calling "Remove-SwisObject $swis $agentUri" on it. It leads to the same place.
To delete the Node, you need the Uri for the node. Given the agent ID, you can get the node Uri with a query like this:
SELECT Agent.Node.Uri AS Uri
WHERE AgentId = 1234
(Note that you need to run this query before you delete the agent, because it won't work after!)
Then you can remove the node like this:
Remove-SwisObject $swis $nodeUri
Thanks for getting back to me and my apologies for replying so late. This is exactly the information I was looking for and I appreciate you taking the time to respond :-)