Compile and load the type... this could be pre-compiled e.g. via dotnet CLI then the type loaded via
Assembly.LoadFrom(...) or Add-Type or Import-Module if part of an actual PowerShell Module.
Once loaded you can Update-TypeData -TypeAdapter
like shown in the example:
Add-Type -Path .\adapterExample.cs -WA 0 -IgnoreWarnings
Update-TypeData -TypeAdapter ([MyPropertyAdapter]) -TypeName ([MyCustomClass])