Consider protecting the psobject in the module and creating accessor functions: Get-OdataClass |new-odataendpoint Not sure if this is really needed. There's not much harm in allowing people to access the objects natively.