Basic Commands:

# Show SPNs
$computername="$env:computername"
Get-ADComputer -Identity $computername -Properties ServicePrincipalNames |Select-Object -ExpandProperty ServicePrincipalNames

# Add one SPN
Set-ADComputer @{Add="WSMAN/$computername"}

# Add multiple SPNs
Set-ADComputer -ServicePrincipalNames @{Add='WSMAN/Mycomputer',"WSMAN/$computername.$env:USERDNSDOMAIN"}

# Edit SPNs
Set-ADComputer -ServicePrincipalNames @{Add='WSMAN/Mycomputer'},@{Remove="WSMAN/$computername.$env:USERDNSDOMAIN"}

# Clear SPNs
# Set-ADComputer -ServicePrincipalNames $Null