Nit, you can call `WriteObject` regardless of the state of the object. If it's null nothing will be shown. No need to do checks etc..