Changing .Net result object to PSObject; Removing useless write commands