There’s a class that will do this in System.Web.
Add-Type -AssemblyName System.Web
[System.Web.HttpUtility]::HtmlEncode('something <somthing else>')
You can even go the other way:
[System.Web.HttpUtility]::HtmlDecode('something <something else>')