How to remove a server from WSUS using PowerShell

Windows Server Update Services (WSUS) is a great tool for keeping all your Windows Server servers up to date in your Active Directory domain. But... The GUI is so g?damn slow. Lets use PowerShell to manage WSUS and to remove a computer object.

$Computername = 'wsus-server'
$UseSSL = $True
$Port = 8531

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | Out-Null
$Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($Computername,$UseSSL,$Port)

$client = $wsus.SearchComputerTargets("server-01")
$client.delete()

That's all.